Sign in to follow this  

Simple Triangle and CullFace

This topic is 1958 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 ??

[CODE]
/////////////////////////////////////////////////////////////////
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);
/////////////////////////////////////////////////////////////////
[/CODE]

thanx
uwi

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

This topic is 1958 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.

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