Jump to content
  • Advertisement
Sign in to follow this  

Simple Triangle and CullFace

This topic is 2177 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!