Jump to content
  • Advertisement

Archived

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

Kirkbag

A little polygon problem...

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

Hey guys, i have a problem. i''m trying to draw a texture mapped blended box, with a sqaure hole in the middle of each wall. so i used 4 quads for every wall, leaving a hole in the middle, but the polygons don''t connect smoothly... and u can notice it especially while rotating the scene. i''m sure there''s a simple solution for this.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
you could map a texture onto the quads, where in the middle a box is cut out (alpha == 0), so one can see through...

Share this post


Link to post
Share on other sites
What do you mean by "do not connect smoothly" ?
You mean the quares between them, or the holes ?
At best, could you give a screenshot ?

The texture solution might not work depending on the problem. Moreover, it would cost more memory, more gpu time, and would need multitexturing if the cube already have a texture mapped. So, I''d recommend using it as a last resort.

Share this post


Link to post
Share on other sites
Using 4 quads by wall is your mistake. Doing that, some vertices are connected to the border of a quad, while maths used for drawing the poly on screen aren't perfect, the vertices don't stay on the border of the quad.

To avoid this, make your wall using 8 quads like this :
  
|--|--|--|
|@@|@@|@@|
|--|--|--|
|@@|##|@@|
|--|--|--|
|@@|@@|@@|
|--|--|--|


(the @ are textured quads, the # is the whole)

Edited by - Melgo on January 16, 2002 7:01:47 AM

Share this post


Link to post
Share on other sites
Melgo, if you draw :
  
+--------+
|\@@@@@@/|
|@\@@@@/@|
|@@+--+@@|
|@@|##|@@|
|@@|##|@@|
|@@+--+@@|
|@/@@@@\@|
|/@@@@@@\|
+--------+

what''s worse than drawing your set of 8 quads, stp ?

The connection seems to be same (at least, geometrically).

Share this post


Link to post
Share on other sites
I think it works too.

The trick is just to avoid things like this :

  
|--------|
|@@@@@@@@|
|--|--|--|
|@@|##|@@|
|--|--|--|
|@@@@@@@@|
|--------|

or this

|-----|--|
|@@@@@|@@|
|--|--|@@|
|@@|##|@@|
|@@|--|--|
|@@|@@@@@|
|--|-----|


cause the polys won''t stay connected when you''ll translate, rotate or scale the scene.

Sorry if you don''t understand all, i read english a lot better than i write (that''s why i draw littles pictures in ascii)...

Share this post


Link to post
Share on other sites
Thanks alot Melgo! that solved the problem, it''s good 2 know these things. this forum is the best resource around for openGL 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!