Archived

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

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

This topic is 5662 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
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
Mmmm.. I didn''t now that Pol mode slowed down your rendering speed..

I made a simple game where I had a few wireframed cubes and I used this command.. I shall go and change it :D

Share this post


Link to post
Share on other sites
If you have good drivers then that''s not really critical, but still slower.
The glPolygonMode command is very handy for debugging, but may not be used for "final" engines.

Share this post


Link to post
Share on other sites
quote:
Original post by vincoof
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.


1. Drawing in wireframe is probably for debugging purposes, so the speed isn''t that important. And if it''s not for debugging (e.g. a 3d modeler, where you can see the top,front,side view in wireframe) most likely speed isn''t that important. Nobody is gona play quake3 in wireframe mode !
2. I haven''t noticed that, when I tried it out, it worked fine for me.

glPolygonMode is by far the simpelest solution.

Share this post


Link to post
Share on other sites
1. that's right that 90% wireframe is used for applications that do not require extreme preformance, but still it's important to keep in mind the speed for critical cases in the other 10%.

2. you may experience that if your polygon has to be splitten because it is partially out of the viewing frustum. Also that may not happen if your drivers are "good enough". ANYWAY it will happen if you split concave polygons using GLU.

[edited by - vincoof on June 13, 2002 4:42:40 AM]

Share this post


Link to post
Share on other sites
Vincoof you say it''s slower, however in theory it should be faster because the poly only has to be textured on the edges, it doesn''t have to be filled so the amount of pixels which need to be calculated is far less compared to a filled triangle.

Share this post


Link to post
Share on other sites
Vincoof you say it''s slower, however in theory it should be faster because the poly only has to be textured on the edges, it doesn''t have to be filled so the amount of pixels which need to be calculated is far less compared to a filled triangle.

Share this post


Link to post
Share on other sites
Yes in therory *giggles*
I''m sorry to be ironic, but in practice 90% of the drivers are at best as fast in wireframe than in solid mode. I know it''s not logical, but that''s the facts, and going a bit further it is logical.

Anyway it is necessarily slower (and that is really logical IMO) to do glPolygonMode(GL_LINE) with GL_TRIANGLES than using GL_LINES.

Share this post


Link to post
Share on other sites
I just the other day was messing with wireframe and solid and they were giving me around the same frame rate. I made wireframe myself using lines and it made a huge difference.

-godkane

Share this post


Link to post
Share on other sites