Hi.

Im updating osgHaptics to reflect the latest changes in osg and also
to remove dependency of Producer in the core osgHaptics library.

Im welcoming the new Camera model instead of having 3-5 places storing
a View/Projection matrix! Thanks for that Robert!


Now I stumbled on a few things.

1. I use to have a Producer::CameraCallback attached to the camera
that I hooked up as a preDrawCallback.

In that callback, the OpenGL Projection, ModelView and View matrix
were all available through OpenGL calls.

Now with osg::Camera using the same mechanism, the call:

   glGetDoublev(GL_MODELVIEW_MATRIX, m_modelview_matrix.ptr());


Returns an identity matrix.
That is the OpenGL state is not yet available in the callback.
Im guessing this is applied later on, perhaps in the renderbin?


As the callback is not a Visitor (!) I cant really use
computeLocalToWorldMatrix() to get the modelmatrix to concatenate this
into the ModelView either...

So I can easily get the Projection and the View Matrix, but not the
ModelMatrix in the preDrawCallback().

Any suggestions?
Im guessing the reason for this redesign is the new threading models,
which is my next question...

2. Im doing Haptic rendering (force rendering using a Phantom) and for
this I'm using OpenHaptics which is sort of tapping into OpenGL for
accessing rendered primitives for extracting what to render haptically
(force rendering).
This makes it sensitive to having OpenGL Contexts generated in
different threads than the Context for the haptic devices...


With the new threading models only two works as I designed OpenHaptics
right now:

OK:  --CullDrawThreadPerContext
OK:  --SingleThreaded

Hangs: --CullThreadPerCameraDrawThreadPerContext
Hangs: --DrawThreadPerContext

The questions is really, in what thread are the OpenGL Contexts
created for the various threading models?
It looks like its done in the main thread for the first two?

Cheers,
Anders

--

-- 


________________________________________________________________
 Anders Backman               Email:    [EMAIL PROTECTED]
 HPC2N/VRlab                  Phone:    +46 (0)90-786 9936
 Umea university              Cellular: +46 (0)70-392 64 67
 S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126
                               http://www.cs.umu.se/~andersb
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to