Re: [osg-users] HMD_Tracker_Synchronization

2008-11-06 Thread Ulrich Hertlein
Hello Ugras,

Quoting Ugras Erdogan <[EMAIL PROTECTED]>:
>       For the purpose of thread synchronization,  I use Windows OS
> synchronization objects. This is also needed because in the lack of
> synchronization the original frame rate of the application and the
> yaw/pitch/roll values acquired from the tracker may go out of sync.
>     My questions are:
> 1)  (As I haven't noticed up to now), does OSG have synchronization  objects
> for the purpose above?

OSG includes the OpenThreads library which has cross-platform support for
threads, mutices(?), conditions etc.  Have a look in include/OpenThreads.

> 2) After obtaining the yaw/pitch/roll values in sync, is "updating the
> virtual camera's viewmatrix" correct way of proceeding or does OSG has some
> specialized functions for this?

You'd usually update the viewmatrix manually in your main loop using one of the
osg::Camera::setViewMatrix*() functions.

Another possibility is to subclass osgGA::MatrixManipulator.  Examples for this
are DriveManipulator, FlightManipulator, etc.

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


[osg-users] HMD_Tracker_Synchronization

2008-11-05 Thread Ugras Erdogan
Dear All,
I've some questions regarding tracker data synchronization with OSG. Here they 
are:

        For tracker hardware read/write/control events, a seperate thread is 
spawned from the main thread and that thread handles all the hardware related 
communication via interrupt driven way and converts the binary readings to that 
of radian angle values.
      For the purpose of thread synchronization,  I use Windows OS 
synchronization objects. This is also needed because in the lack of 
synchronization the original frame rate of the application and the 
yaw/pitch/roll values acquired from the tracker may go out of sync.
    My questions are:
1)  (As I haven't noticed up to now), does OSG have synchronization  objects 
for the purpose above?
2) After obtaining the yaw/pitch/roll values in sync, is "updating the virtual 
camera's viewmatrix" correct way of proceeding or does OSG has some specialized 
functions for this?

Best regards,
Ugras
 


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