Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Categories
- All Discussions1,524
- General534
- Graphics109
- GPU Computing419
- Mobile141
- Pro Graphics163
- Tools158
In this Discussion
- Detlef Roettger January 5
- luotingfu January 12
Tags in this Discussion
- scenix 87
How do i draw on-screen graphics by sub-classing GeoNode, Traverser and Renderer?
-
Hi,
I am attempting a scenario where I could add 3D GeoNodes that are drawn as usual and viewed by a perspective cam, and GeoNode derivatives that are drawn in 2D screen coordinates viewed by a parallel camera. In the past, I hacked in tovoid SceniXQGLSceneRendererWidget::paintGL() in SceniXQGLSceneRendererWidget.cppand addedGLMatrixMode(GL_PROJECTION);
GLLoadIdentity();
GLMatrixMode(GL_MODELVIEW);
GLLoadIdentity();
to change change the coordinate and camera. And then I rendered the 2D on-screen geometry using good-old immediate mode glDraw issued within SceniXQGLSceneRendererWidget::paintGL().
Now I am much more interested in making the on-screen geonode more SceniX-ish, or, more scene-graph-ish. So I am thinking:
1) How do I extended the SceniX node family by sub-classing GeoNode? What specifics (e.g., object code) do I need to pay attention to? In 6.x there used to be a page within the chm help doc that describes this, but now I could not find any in the 7.x chm.
2) Where do I insert the GLLoadIdentity prior to rendering the on-screen stuff? Do I subclass the GL2 renderer and add a new handle method specialized for the oc of my GeoNode-sub-class?
3) How do I preclude the on-screen geometry from being included in the scene sphere / scene bounding box calculation, and prevent them from being traversed by the, say, stat traverser? Should I do it via the traverse mask?
I could not find pointers to the above questions in the help chm. Any suggestion would be gratefully appreciated!
Thanks! -
2 Comments sorted by
-
Repeating my answer from last year which got lost due to an unfortunate forum database index corruption.
If you require just a very simple scene graph nodes independent 2D HUD rendering which you already implemented with standard OpenGL calls, I prepared the simple GLUTMinimal_HUD example for exactly that. Full source is attached here:
http://forums.developer.nvidia.com/devforum/discussion/2991/scenix-7.2-simple-hud-text-rendering
That is basically your bullet point 2) in about 60 lines of code.
This HUD rendering is completely independent of the scene graph contents, which answers your 3).
If you require the 2D HUD display elements to follow the 3D geometry inside your scene, there would be some more work necessary for the final screen coordinate. Let us know what you need it for. -
probably due to the previous forum crash, i m now unable to mark this as Answered...