Hello there!
I’m working on a 3D Viewer with openGL and Qt. It already works. I did not write the basic view and camera system myself, i just proceed the code of some other developers.
So I’m not very familiar with how it works in detail, but i can find out if necessary.
All spinning and rotation of the view works (in some terms).
Lets assume everything is allright.
Now my Problem:
I load a Mesh file from a .obj. I generate a Display list.
There ist a “draw()” function that is called every time the view changes.
ignoring all redundant code i do the following:
[b]preDraw();// initialize GL as common
void SViewer3d::draw(){
if ( mesh && _bDrawMeshobject ) {
glPushAttrib( GL_ALL_ATTRIB_BITS );
glEnable( GL_LIGHTING );
mesh->callMeshDisplayList();
glDisable( GL_LIGHTING );
glEnable( GL_COLOR_MATERIAL );
glPopAttrib();
}
}[/b]
The Point is: this does not work without a glu-Object.
glIsList(gliMeshDisplayList) is ‘FALSE’ and all the spinning and rotation and zooming stuff does nothing. But my Mesh ist displayed static and once.
now i add:
if ( _bDrawMeshobject) {
static GLUquadric *quadric = gluNewQuadric();
gluSphere( quadric, 0.025, 10, 10 );
}
to my draw() Method, and everything works fine. The Sphere could be any GLU-Object. It also works with all the others.
I know that maybe the error is hidden deeper in the other routines, but before i spent more hours and hours searching (and i already did) i thougt i ask you. Seems like a typical problem that a noob like me is faced.
I would be very thankful for every piece of information that you can offer me. Even if you have a little clue. Right now i have no idea…