Hello Martin,

Martin Wewior wrote:
>>> [implementing headtracking]
>> what does your setup look like, that is do you have an HMD, a (large)
>> single screen, or a CAVE-like environment?
> 
> I'll provide some background information: We are developing a
> cooperative visualisation tool, which is currently focused on desktop
> rendering. ("We" are at the Regional Computing Centre of the University
> of Cologne)
> 
> This desktop tool should be enabled for VR-installations in general. But
> the first step is a single screen (rear-projection, two projectors,
> polarizing filters).
> Currently we are using OpenSG 1.8. Using 2.0 is desired but not actually
> planned.
> 
>> What do you specifically want to know about the ProjectionCameraDeco?
>> Basically it works by defining a projection surface in the coordinate
>> system of the decorated camera and the user position relative to the
>> decorated camera. So data from your headtracker influences the user,
>> while to navigate around the scene you'd modify the camera's beacon.
> 
> We have implemented stereo projection using
> ShearedStereoCameraDecorator-objects decorating the camera. Which works
> as expected. Reading further, we came across this directions
>> http://www.opensg.org/htdocs/doc-1.8/PageSystemWindow.html#PageSystemWindowCameraDecoratorsStereoProjection
> In theory it is obvious, what needs to be done.
> We studied
>> http://www.opensg.org/htdocs/doc-1.8/classosg_1_1ProjectionCameraDecorator.html
> and could not distil the relevant information:
> 
> 1) According to the description the corners of the projection screen
> have to be set. Which function needs to be used to to so?

something like this should do it:

Pnt3f screen_pnts[4];
ProjectionCameraDecoratorPtr pcd;

pcd->editMFSurface()->push_back(screen_pnts[0]); // lower left
pcd->editMFSurface()->push_back(screen_pnts[1]); // lower right
pcd->editMFSurface()->push_back(screen_pnts[2]); // upper right
pcd->editMFSurface()->push_back(screen_pnts[3]); // upper left

> Which
> coordinate system/units have to be used?

hm, I don't remember exactly, but using the same coord system/units that 
the tracking data for the users head is in would make sense.

> 2) From the tracking system we obtain coordinates of the user's eyes in
> mm from an arbitrary origin.

this is arbitrary, but fixed and known?

> This has to be passed to the system in coordinates relatively to the
> camera. So there has to be a node, which is a child of the
> camera-beacon. This is transformed(translated/rotated) corresponding to
> the position of the tracked user to the centre of the screen?

yes, create a Node (userBeaconN) with a Transform core, make it a child 
of your camera beacon and pass it as the user beacon:

camBeacon->addChild(userBeaconB);

pcd->setUser(userBeaconN);

If you write your tracking data to that Transform core it is used as an 
offset from the camera position to give you the correct shape of the 
frustum.
Basically the idea is that changing the camera beacon allows you to 
navigate your scene, while changing the "user" accounts for the head 
tracking.

> There are private functions which seem connected to this (e.g. NodePtr
> &getUser(void) ) but I do not see how the actual implementation should
> be done, i.e. how and which functions need to be utilised.

getUser() is public in ProjectionCameraDecoratorBase as well as the 
other field accessors (surface, width, height).

        Cheers,
                Carsten

------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to