Jump to content
  • Advertisement
Sign in to follow this  
supagu

GL_LINES

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

should the code eblow work? im trying to draw a list of lines, but nothing seems to be comming up? <cpp> StarField::StarField(int numStars) { stars.resize(numStars); for (int l = 0; l < stars.size(); ++l) { stars[l].start = Vector3(rand() % 1000 / 100.0f, rand() % 1000 / 100.0f, rand() % 1000 / 100.0f); } } void StarField::Update(Vector3 change) { for (int l = 0; l < stars.size(); ++l) { stars[l].end = Vector3(0,0,0); //stars[l].start + change; } } void StarField::Render(Camera& camera) { camera.LookAt(); glLoadIdentity(); glLineWidth(5); glColor4f(1,1,1,1); glBegin(GL_LINES); { for (int l = 0; l < stars.size(); ++l) { Vector3 start = stars[l].start; Vector3 end = stars[l].end; glVertex3f(stars[l].start[Vector3::X], stars[l].start[Vector3::Y], stars[l].start[Vector3::Z]); glVertex3f(stars[l].end[Vector3::X], stars[l].end[Vector3::Y], stars[l].end[Vector3::Z]); } } glEnd(); } </cpp>

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by supagu

camera.LookAt();
glLoadIdentity();


Is that really what you want, loading the identity matrix right after setting the camera?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!