Archived

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

only render one edge of QUAD

This topic is 5581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Well maybe not only render one edge but make only one edge visible... I have my terrain rendered using quads... Some quads I want to have a line rendered through it...like so
3----------------2
|                |
edge3   ep\              |  edge1
|  \----\        |
|        \-------ep
|                |
0----------------1
[\code]
0, 1, 2, 3 are vertices of the original quad...ep are edge points
that help produce 2 new quads by splitting the original...

Now I only want to see the line between edge3.ep and edge1.ep

So Im rendering 2 quads now... vert 2,3, edge3.ep and edge1.ep
and...
vert 0, 1, edge1.ep, edge3.ep...

During rendering of quad I make verts 0, 1, 2, and 3 have 0.0f alpha color values and verts edge3.ep and edge1.ep alpha color values 1.0f...
at first I thought this would work fine, but OpenGL gradually interpolates the opacity between the ep edge and the original vert edges...

Does anyone have a clue as to how I could only render the line between edge1.ep and edge3.ep?

Share on other sites
duh...

glBegin(GL_LINES);
glVertex3f(edge1.ep.x, edge1.ep.y, edge1.ep.z);
glVertex3f(edge2.ep.x, edge2.ep.y, edge2.ep.z);
glEnd();

either the rest of you were sleeping, or I didn't
quite make the question as clear as it could have
been... anyway...taking breaks helps solve problems
for sure!

www.lanceusa.com
[/source]

[edited by - dnagcat on July 6, 2003 2:04:31 AM]

Share on other sites
Even though you''ve answered your own question, you may want to use degerated quads, rather then using lines.

(ep, ep)
(ep1, ep1)
(ep1, ep1)
(ep1, ep1)

It will help you when you try to use display lists, because you won''t have to switch contexts to render lines, you can render lines in the same list...

~~~~~
SNOBOL-If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 13
• 14
• 9
• 9
• 9
• Forum Statistics

• Total Topics
632927
• Total Posts
3009241
• Who's Online (See full list)

There are no registered users currently online

×