Sign in to follow this  

Simple Triangle and CullFace

Recommended Posts

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 ??

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


Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this