[osg-users] 2D drawing over a 3D drawing

Gianluca Natale gianluca.natale at adstorino.it
Mon Mar 23 03:49:05 PDT 2009


Hi All.
I need to draw a 2D drawing (a single wireframe rectangle) over a 3D drawing
of a scene. Basically I need it to show a window selection in the scene.

In OpenGL, I would set a perspective projection like glFrustum(.), draw the
scene, then set a glOrtho2D(.), and draw the rectangle. Finally I would call
a swap buffers.

How can I do it with OSG?

I mean, in OSG the projection matrix is associated with a camera. So, should
I use two cameras, one for the 3D scene, the other just for the 2D
rectangle?

In camera::frame there is the swap of the back and front buffers. But I
would like to swap those buffers just at the end, after drawing everything.

So, should I call the drawing of the 3D camera without swapping, then the
drawing of the 2D camera with swapping at the end?

I read in the quick start guide of OSG of the thread for draw traversal.
Since I call camera::Frame twice, does OSG create 2 different threads?

Is there any conflict between those threads, since they draw with different
projection matrices?

 

Thanks in advance

Gianluca Natale

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090323/c6df3a8f/attachment-0002.htm>


More information about the osg-users mailing list