Jump to content
  • Advertisement
Sign in to follow this  
Endar

Rotating cube

This topic is 4929 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
Advertisement
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
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!