Jump to content
  • Advertisement

Archived

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

Nukem

Draw a line from point a to b to c to d to a

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

Im making a 3d character file and im trying to make it in wire form now. I write a simpal file to draw a square. But when its in wire form it draws to lines unconnected, in quad form it draws the hole thing together. Here are my coors (x, y, z) (0, 0, 0) (1, 0, 0) (1, 1, 0) (0, 1, 0) That is what is comming from Print.
  
  void Display()
  {
    AXIS axy;
    int a = 0;

    glBegin(GL_LINES);
    //glBegin(GL_QUADS);


    while(Print(ngc, a, &axy))
    {
      glVertex3f(axy.x, axy.y, axy.z);
      a++;
    }

    glEnd();
  }
  
Dose any one have any ideas why this is doing this? thx nuke

Share this post


Link to post
Share on other sites
Advertisement
use

glBegin(GL_LINE_STRIP);
//point a
//point b
//point c
//point d
//point ect...
glEnd();

Share this post


Link to post
Share on other sites
wow... i didn''t know that... but that might not be the best in this case... he might end up with a line going through the middle of the cube and that wouldn''t be good. -PmanC

Share this post


Link to post
Share on other sites
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

call this function and everything will be drawn in a wireframe

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

call this to set it back to normal

Share this post


Link to post
Share on other sites
I''m sorry but I have to disagree.
This may work, but has two major disadvantages :
1- it slows own a lot the rendering. Depending on your graphics card it may even switch to software rendering !
2- it doesn''t necessarily give you the rendering you want. For instance if one polygon is drawn half inside the viewing frustum and half outside, then the splitten triangles may appear.

In fact, you would have to play with the glEdgaFlag command which is bad known from general programmers.

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!