Re: [osg-users] how to get view pointer from cullvistor

2014-07-01 Thread LearningOSG LearningOSG
Hello Wu Zhicheng,
  Try following code will help you
osgViewer::Renderer* renderer =
dynamic_castosgViewer::Renderer*(_p_viewer-getCamera()-getRenderer());
assert(renderer);
p_sceneView=renderer-getSceneView(0);
p_sceneView-getViewMatrix()
   p_sceneView-getProjectionMatrix()

  cheers

Learned osg six months


2014-07-01 9:52 GMT+08:00 ttaw wattha...@qq.com:

 Hi, all:
   I'm trying to get view pointer in traverse function. I used:
 CullVisitor *cv = dynamic_castCullvsitor *(nv);
 cv-getCurrentCamera()-getView();
   This wouldn't work if the current node is a child of a Camera node which
 is in the scenegraph.I'm wondering how to achieve this. Could anybody give
 me some advices? Thanks in advance.

  --
  Failure is the mother of success.
 Wu Zhicheng


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OpenSceneGraph 3.2.1 release candidate 5 tagged, please test

2014-07-01 Thread Robert Osfield
HI Tom,


On 30 June 2014 22:45, Jolley, Thomas P thomas.p.jol...@boeing.com wrote:

  One of my Linux machines had trouble with uint64_t not naming a type in
 applications/osgviewer/osgviewer.cpp.  When I included stdint.h it
 compiled fine.


Which Linux distro did it have?

I've added the stdint.h to osgviewer.cpp and checked it into svn/trunk and
OSG-3.2 branch.





 I got a couple other warnings about variables may be used uninitialized.
 When I tracked them down it wasn't a problem.  If you would like to know
 where these are, let me know.



 Another Linux machine reported GetValueVisitor and SetValueVisitor, in
 include/osg/ValueObject , had virtual functions without a virtual
 destructor.  I didn't look into it far enough to determine if it is a
 problem.


Could you send me the warnings.  I may not be able to do anything about
them in the OSG-3.2 branch if resolving them affects the ABI but can
certainly look at addressing them in svn/trunk.

Thanks,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to get view pointer from cullvistor

2014-07-01 Thread Robert Osfield
Hi Wu Zhicheng,

The osg::RenderInfo object is used to track the current View and active
Cameras. It's primary use is within the graphics traversal (the RenderInfo
object is passed to Drawable etc.), but you can also get it from the
CullVisitor using the CullVisitor::getRenderInfo() method.  so:

  osg::View* view  = cullvisitor-getRenderInfo().getView();

Robert.



On 1 July 2014 02:52, ttaw wattha...@qq.com wrote:

 Hi, all:
   I'm trying to get view pointer in traverse function. I used:
 CullVisitor *cv = dynamic_castCullvsitor *(nv);
 cv-getCurrentCamera()-getView();
   This wouldn't work if the current node is a child of a Camera node which
 is in the scenegraph.I'm wondering how to achieve this. Could anybody give
 me some advices? Thanks in advance.

  --
  Failure is the mother of success.
 Wu Zhicheng


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to get view pointer from cullvistor

2014-07-01 Thread Robert Osfield
On 1 July 2014 08:18, LearningOSG LearningOSG learning...@gmail.com wrote:

 Hello Wu Zhicheng,
   Try following code will help you
 osgViewer::Renderer* renderer =
 dynamic_castosgViewer::Renderer*(_p_viewer-getCamera()-getRenderer());
 assert(renderer);
 p_sceneView=renderer-getSceneView(0);
 p_sceneView-getViewMatrix()
p_sceneView-getProjectionMatrix()

   cheers

 Learned osg six months


If you don't actually have the answer could you please wait for others in
the community to attempting to answering the question as your answer is
incorrect and misleading.

Could you also please start using a human name.  It can be a psuedoname if
you wish to remain anonymous, but we are all humans here, it's best to
communicate as humans, we have a well establish policy of using human names
in the community.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Re?? how to get view pointer from cullvistor

2014-07-01 Thread ttaw
ok,robert.Thank you for your reply.I will have a try.-- 
Original --
From: Robert Osfieldrobert.osfi...@gmail.com
Date: Tue, Jul 1, 2014 03:49 PM
To: OpenSceneGraph Usersosg-users@lists.openscenegraph.org;
Subject: Re: [osg-users] how to get view pointer from cullvistor


Hi Wu Zhicheng,

The osg::RenderInfo object is used to track the current View and active 
Cameras. It's primary use is within the graphics traversal (the RenderInfo 
object is passed to Drawable etc.), but you can also get it from the 
CullVisitor using the CullVisitor::getRenderInfo() method.  so:
 

  osg::View* view  = cullvisitor-getRenderInfo().getView();


Robert.





On 1 July 2014 02:52, ttaw wattha...@qq.com wrote:
 Hi, all:
   I'm trying to get view pointer in traverse function. I used:
 CullVisitor *cv = dynamic_castCullvsitor *(nv);
 cv-getCurrentCamera()-getView();
   This wouldn't work if the current node is a child of a Camera node which is 
in the scenegraph.I'm wondering how to achieve this. Could anybody give me some 
advices? Thanks in advance.
  
  --
  Failure is the mother of success.
 Wu Zhicheng


  

___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] ?????? how to get view pointer from cullvistor

2014-07-01 Thread ttaw
In my case,the renderer of the camera is null,so it is not a solution.Thank you 
anyway.--  --
??: LearningOSG LearningOSGlearning...@gmail.com
: 2014??7??1??(??) 3:18
??: OpenSceneGraph Usersosg-users@lists.openscenegraph.org;
: Re: [osg-users] how to get view pointer from cullvistor


Hello?Wu Zhicheng,? Try following code will help you
 ??? ? ? osgViewer::Renderer* renderer = 
dynamic_castosgViewer::Renderer*(_p_viewer-getCamera()-getRenderer());
? ? ? ? assert(renderer);
 ? ? ? ? p_sceneView=renderer-getSceneView(0);
? ? ? ??p_sceneView-getViewMatrix()
? ? ? ?p_sceneView-getProjectionMatrix()


? cheers

 

 Learned osg six months



2014-07-01 9:52 GMT+08:00 ttaw wattha...@qq.com:
 Hi, all:
 ? I'm trying to get view pointer in traverse function. I used:
 CullVisitor *cv = dynamic_castCullvsitor *(nv);
 cv-getCurrentCamera()-getView();
 ? This wouldn't work if the current node is a child of a Camera node which is 
in the scenegraph.I'm wondering how to achieve this. Could anybody give me some 
advices? Thanks in advance.
 ?
  --
  Failure is the mother of success.
 Wu Zhicheng


 ?

___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSG 3.2 and GLSL 330 light and shadows

2014-07-01 Thread Solkar Graphics
Hi!

I've written plenty of #version 330 core GLSL shaders I'd like to reuse along 
with the OSG 3.2.0 framework, and try to figure out how to get the state from 
the OSG I need to pass in by uniforms, and how to set them without having to 
change well-tested shader code, as well as how to populate arbitrarily named 
attributes.

Some example give rise to a notion of aliasing certain attribute and uniform 
names to osg_, but I'd like to use arbitrary names for the uniforms,


Code:
uniform mat4 uMVMatrix;
/*...*/


and to refer, or let the OSG refer, to the attributes by their numbers only, so 
sth like this


Code:
/*...*/
layout(location = 0) in vec4 aPosition;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aST;


as used in my legacy shaders, I'd like the OSG framework to populate with the 
vbo it already maintains for the Drawables, or, at least, use an API call and 
do it myself.

I addition, I'd like to populate uniforms for lights and shawdowmaps by means 
of the scenegraph and the visitors; somewhere and somehow in the SG there 
must be light and esp shadow information be aggregated for default shading, so 
I'd like simply like to use this data and tailor it to fit to my custom shaders.

So the fundamental question is

How to populate arbitrary GLSL 330 shaders with data from within OSG without 
having to resent to redundant uniform assignment - providing my u[..]Matrix 
manually in addition to the osg_[...] uniform set by OSG - or changing 
attribute names in the shader sources?

With kind regards,
S.

P.S.: !0 days ago I asked this at Stack Overflow¹ (SO) but, despite  even 
offering a bounty  (a SO feature) I received no answer yet, and have 
requested to close the thread there, so I don't. think cross-posting oddities 
are to expected.

¹my first post, I'm not allowed to post links yet here

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60078#60078





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Access vertexes of a 3D model in the vertex shader

2014-07-01 Thread Solkar Graphics

Becky wrote:
 Would someone tell me how to access all the vertexes of a 3d model in the 
 vertex shader? 


Hi Becky!

You would need to define a mapping from vertex numbers to st coordinates,  
then store the position data in a texture according to that mapping and provide 
that texture via a sampler uniform.
.

Best regards,
S.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60082#60082





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Disable GUIEventHandler

2014-07-01 Thread Robert Gosztyla
Hi,

I have in my project few pickers (for models, triangles, points) based on 
osgGA::GUIEventHandler. All of them are added to viewer... but i would like to 
have them selectable to work somehow (i mean one active in current time). All i 
found is method removeEventHandler(), but it seems to destroy my picker 
(destructor is called). They are singletons and are using also other data, so 
destroying them is not best idea. Is there any way to disable event handler for 
some time without destroying it?

Thank you!

Cheers, Robert

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60100#60100





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem of creating integer texture

2014-07-01 Thread Hao Wang
Nobody answers the question ,strange
Cheers,
Ma[/quote]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60101#60101





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org