Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Tree Penguin

Line coloring??

This topic is 5195 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, i wanted to draw a line with for each vertex a different color, is this impossible using opengl or something as it just wouldn't work for me, if so, is there a way around that (EDIT: besides mapping a texture onto it)? Thanks [edited by - Tree Penguin on March 5, 2004 1:49:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
Have you tried to set a per-vertex color? It would be interpolated. Is this what you need?

Can you please try to be more clear next time you post something, by spending an extra minute? It''s rather difficult to answer to a problem which is not explained enough.

Share this post


Link to post
Share on other sites
Well that''s exactly the problem, this:

glColor3d(0.45,0.45,0.45);
glVertex2i(0,11);
glColor3d(1.0,0.0,0.0);
glVertex2i(m_WindowWidth,11);

gives me a red line, not interpolated.

Share this post


Link to post
Share on other sites
For some reason it blends in with mine, two colors:

glBegin(GL_LINES);
glColor3f(1.0,1.0,1.0);
glVertex3f(1.0,1.0,-5.0);
glColor3f(0.0,0.0,1.0);
glVertex3f(3.0,3.0,-5.0);
glEnd();


What does your initialization for the opengl enivironment code look like?

Share this post


Link to post
Share on other sites

  • 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!