Simple Triangle and CullFace

Started by
0 comments, last by MARS_999 11 years, 8 months ago
Hi all,

seems i am not at my best today...
for one houre i am dealing with a simpl VertexArray to be displayed.

Finally the Triangle shows but only from one direction... when the camera mooves it´s gone pretty soon ...
Yess ... Cullface i know ... but i disable it allready ...

What may i have forgotten ??


/////////////////////////////////////////////////////////////////
glDisable(GL_CULL_FACE);
// activate and specify pointer to vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, MyArena->vertices );
// draw a cube
glDrawArrays(GL_TRIANGLES, 0, 200);
// deactivate vertex arrays after drawing
glDisableClientState(GL_VERTEX_ARRAY);
/////////////////////////////////////////////////////////////////


thanx
uwi

uwi2k2 - parttime Game-Dev
---------------------------------------------------------
OpebGL Trainer: www.opengl-trainer.com
deCode Company: www.decode.ro

Advertisement
I am surprised that glDrawArrays() works with 200 as a triangle needs 3 indices to render it... that would end up being like 66.6666 triangles....

Anyway, not sure what you are trying to render but if this a flat object and you move your camera its probably on end and you can't see it as the object has no depth to it. Make a cube first and then try again or a sphere....

better yet use the built in glut shape functions to make sure your code is setup correct and then try again.

This topic is closed to new replies.

Advertisement