Re: [osg-users] [forum] How to acquire the current location information of a drawable object? And how to calculate the distance between an object and the viewpoint?

2012-07-04 Thread WangWentao


在 2012-7-2,22:48,Fan ZHANG oceane...@gmail.com 写道:

 Hi all,
 
 I'm quite new to OSG and have no OPENGL background.
 
 I want to know how to acquire the current location information of a drawable 
 object?
 Actually the initial position of the geometry is set by me. But when I move 
 the objects with mouse, the spatial information changes, right? So I want to 
 acquire such information.
 
the world coordinate of a drawable is determined by scene graph. So it's world 
coordinate never change before you change the scene graph, logically.

What you see after mouse action is probably controlled by view matrix and 
projection matrix. The pipeline looks like: object coordinate -- world 
coordinate -- eye coordinate -- device coordinate -- window coordinate. View 
matrix affects the eye coordinate and projection matrix affects the device 
coordinate. Mouse action will change the two matrixes.
 
osg::Camera maintains these matrixes.

 For the second question, how to calculate the distance between an object and 
 the viewpoint? Because I want to differentiate the 'stateset' when objects 
 are far away from the viewpoint and when they are close to the camera. And I 
 don't even know where the camera viewpoint is!
 
viewpoint can be accessed in CullVisitor, so you should get it in cull 
traversal, by defining a cull callback and adding it to a Node.

 Regards and thank you!
 
 Cheers,
 Fan
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=48628#48628
 
 
 
 
 
 ___
 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] Ho to change slave cameras offset matrix later on?

2012-07-04 Thread WangWentao
osg::View::getSlave(index)
Get slave and do everything you want, Viewer will update their matrixs each 
frame.



在 2012-7-1,22:03,Torben Dannhauer tor...@dannhauer.info 写道:

 Hi,
 I would like to change a slave cameras viewOffset and projectionOffset matrix 
 _after_ I added the camera via viewer-addSlavecamera(camera, 
 viewoffset,projOffset).
 
 Is there a interface to set the offsets later on? I haven't found anything.
 
 What would you recommend to achieve the desired functionality?
 Maybe I should add some functions to allow later changes and submit it to 
 Robert.
 
 Thank you!
 
 Cheers,
 Torben
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=48621#48621
 
 
 
 
 
 ___
 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] Clipping planes for slave camera

2012-07-04 Thread WangWentao
Slave camera relies on main camera matrix and matrix offset, so it's 
meaningless to set their matrix. By contrast, view camera is independent of 
other view.



在 2011-9-27,23:05,He, Yefei yefei...@uiowa.edu 写道:

 Thanks, Robert, I'll take a look at the examples. Another question: in a 
 composite viewer, if I set the view and projection matrices directly on the 
 slave camera, what are the internal differences between doing this and simply 
 creating another view and setting the view and projection matrices of its 
 camera? I'm trying to set up a composite viewer with multiple views of the 
 same scenegraph. I noticed that the main view (the first view added to the 
 composite viewer) and its slave cameras all render properly, but in the 
 contents of the other views, the depth sorting is incorrect, most noticeably 
 the skydome obscures a lot of faces that should be in front of the skydome.
 
 Yefei 
 
 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Tuesday, September 27, 2011 3:16 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Clipping planes for slave camera
 
 Hi Yefei,
 
 On Mon, Sep 26, 2011 at 9:20 PM, He, Yefei yefei...@uiowa.edu wrote:
 Is it possible for a slave camera to have different near and far 
 clipping planes from the master camera? Are there examples for it? I 
 figure it will be more complicated than changing the angle of view or 
 adding a shear to the view frustum.
 
 You have assign different projection matrices to the slave camera either by 
 setting the projection offset matrix for the slave and keeping the slave 
 Camera's ReferenceFrame set to RELATIVE_RF (relative the master Camera) or by 
 setting the view and projection matrices directly on the slave Camera and 
 setting the ReferenceFrame to ABSOLUTE_RF.
 
 There isn't a specific example that illustrates what you want but the osghud 
 and osgdistortion examples should give you an idea of the different things 
 you can.
 
 Robert.
 ___
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Parallel Rendering Problems using NVidia GPU cards in Windows

2012-06-29 Thread WangWentao
how about 2 same GPUs?



在 2012-6-29,21:18,Stefan Eilemann eilem...@gmail.com 写道:

 
 On 26. Jun 2012, at 8:57, GeeKer Wang wrote:
 
 In fact, Windows NVidia driver will try to send OpenGL cammands to all GPU 
 when SLI model disabled.
 
 NVidia drivers =256.0 send the commands to the most powerful GPU and then 
 blit the result to the display GPU. You can override the GPU on a 
 per-application base in the control panel, afaik. On Linux this is a 
 non-issue, as you address the GPUs through X screens.
 
 
 Cheers,
 
 Stefan.
 
 
 ___
 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