Hi,
In my OSG based application, I need to draw some openGL objects with
texture. So I used glpush and glpop before and after the code to draw OSG
objects. But the some of the OSG objects can’t display on the screen. Below is
part of the code:
//-----------------------------------------------------------------
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_TEXTURE_BIT);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
//=====do SceneView::update and SceneView::cull here
StageInterface::Update();
//=====do SceneView::draw here
StageInterface::Render();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glPopAttrib();
glPopClientAttrib();
//-----------------------------------------------------------------
If using the code above, some of the OSG objects can’t display on the screen.
It seems as some triangles of the OSG objects are lost.
If I don’t use “glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT)” and
“glPopClientAttrib()”, all the OSG objects can be seen on the sceen, but the
texture of the openGL objects is wrong at the beginning of the rendering.
I didn’t find a way to solve the problem. Did OSG does some sets about vertex
array itself? Or is there any other set must be done?
Thanks~
Wangzhu
[EMAIL PROTECTED]
2007-09-28
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org