Jump to content
  • Advertisement
Sign in to follow this  
nickme

opengl : outline did not show.

This topic is 2528 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 wrote a 3d graphic function with light. when i added GL_LINE to the program it was as if it wasn't there:it did not show the lines. the code is as follow:

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glBegin(GL_TRIANGLE_FAN);
normal(Map[j], Map[j+1], Map[j+1][i+1], n);
glNormal3fv(n);
glVertex3fv(Map[j]);
glVertex3fv(Map[j+1]);
glVertex3fv(Map[j+1][i+1]);
glVertex3fv(Map[j][i+1]);
glEnd();

// here it suppose to show the line here
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glPolygonOffset(1.0, 1.0);
glColor3f(0.0, 0.0, 0.0); // black lines
glBegin(GL_QUADS);
glVertex3fv(Map[j]);
glVertex3fv(Map[j+1]);
glVertex3fv(Map[j+1][i+1]);
glVertex3fv(Map[j][i+1]);
glEnd();
what do i have to do to make it show the lines as my second part of my program above shown.

thanks

Share this post


Link to post
Share on other sites
Advertisement
HI,
yes, i do know how to render a triangle. i rendered a 3D sin function graph, but i want a out-line shown on the rectangle that the second half of my codes shows.

Share this post


Link to post
Share on other sites
hi,
i just want to add that, without adding light, i can render the graph and the outline. it is the lighting that gives me trouble.
thanks

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!