Sign in to follow this  

Rotating cube

This topic is 4714 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

Okay, the subject line doesn't really describe the problem, but anyway. I've got a cube class and its drawing fine and rotating fine and all, but my problem is that I'm trying to be able to highlight the vertices at each corner of the cube.
glBegin(GL_POINTS);

	glVertex3f(vertex_array[0].x, vertex_array[0].y, vertex_array[0].z);
	glVertex3f(vertex_array[1].x, vertex_array[1].y, vertex_array[1].z);
	glVertex3f(vertex_array[2].x, vertex_array[2].y, vertex_array[2].z);
	glVertex3f(vertex_array[3].x, vertex_array[3].y, vertex_array[3].z);
	glVertex3f(vertex_array[4].x, vertex_array[4].y, vertex_array[4].z);
	glVertex3f(vertex_array[5].x, vertex_array[5].y, vertex_array[5].z);
	glVertex3f(vertex_array[6].x, vertex_array[6].y, vertex_array[6].z);
	glVertex3f(vertex_array[7].x, vertex_array[7].y, vertex_array[7].z);

glEnd();

Now I can see where it highlights each vertex, except that each point is about a pixel in size. Any ideas on how I can increase that to a larger cross-section that will be easily visible?

Share this post


Link to post
Share on other sites
well, your drawing points. so points is all you'll get. Change GL_POINTS to GL_TRIANGLES and draw out the triangles. That should get the effect your after, if I read your post right.

Share this post


Link to post
Share on other sites
If you want cross sections between each vertex of each face, look into drawing lines in OGL.

I believe this: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=21 is the correct tutorial on NeHe for drawing lines. Lots of code, but I'de wager that you're used to scanning through alot of lines by now.

Share this post


Link to post
Share on other sites

This topic is 4714 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