Hello Benoît, On 01/18/2011 03:50 AM, Benoît Bossavit wrote: > Naively, i set my camera at one position and one orientation (looking at > the center of my screen) and i consider the user doesn't move the head > during the application, but it doesn't work correctly. The scene is not > mapped correctly.
ok, just to avoid confusion about terminology, in the following when talking about the camera I mean the decoratee of the ProjectionCameraDecorator (PCD). The camera's position in the scene is (as always for OpenSG) determined by its beacon's coordinate system. In that coordinate system the camera is in the origin looking down the negative z axis. The "user" node of PCD determines where the users head is in the scene, quite often it makes sense to make this a child of the camera beacon. That way you manipulate the camera beacon to navigate in the scene and use the user node to contain the head tracking offset. > So, I saw the openSG code, particularly into > ProjectionCameraDecorator.cpp where stereo and head-tracking were > integrated. I saw that OpenSG edits the projection surface and uses it > to construct the frustum. > So, in my application i defined my screen into world coordinate (with an > own world center), The projection "surface" of the PCD is given in the _camera_ coordinate system. So when you move the camera through the scene you also move the projection surface with it. The "user" node can move independent from that in front of the surface. > then i set my camera with my head position relative > to this world center and i set my 3D object on the world center. And > then i compute my frustum as ProjectionCameraDecorator::getProjection() > method. But the result is not good because i'm not seeing my scene !! If > i move my camera manually, the camera seems seeing above the scene... > > But when i read the code, the frustum plane is constructed with camera > position and not orientation. How it is possible to compute frustum > without camera orientation? I suppose i'm wrong in this part but i don't > understand how it's work into openSG... the frustum is determined by "connecting" the eye positions with the four corners of the projection surface. Camera orientation only matters when determining where the eyes actually are (they are shifted along the pos/neg camera x-axis). > For me, in stereo we have two parameters, eye separation and focal > length..the focal length it's the distance between camera position and > the crossing point of the 2 eyes (determined by the orientation of camera). > If we don't consider the orientation to compute the frustum, we are not > considering the focal length parameter, isn't it? and the only way to > play with stereo is the eye separation parameters, i'm wrong? the crossing point for the two eyes is in the projection plane, I don't think camera orientation matters for this. Cheers, Carsten ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users