Archived

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

NeilArrow

Complete Beginners Question

Recommended Posts

NeilArrow    122
Hi, I was playing around yesterday with my first attempts at some 3D graphics. I''ve been looking at the excellent 5 part tutorial in the resources section of gamedev.net (can''t remember the authors name, but he used to work on Duke Nukem 4). I''ve got a nice wire-frame cube that rotates, and I can move towards and away from it nicely. When I move into it though, and one of the points goes "behind" my camera, everything goes crazy, with all the wrong corners joining up together. I''m probably missing something really obvious here, but what''s a simple way of avoiding this happening? Thanks in advance for humouring a novice, Neil

Share this post


Link to post
Share on other sites
zedzeek    529
going crazy aint really the best description.
maybe its being clipped by the near buffer.
or the cameras in the cube and youre doing backface culling

Share this post


Link to post
Share on other sites
Kertropp    122
quote:
Original post by NeilArrow
I''ve got a nice wire-frame cube that rotates, and I can move towards and away from it nicely. When I move into it though, and one of the points goes "behind" my camera, everything goes crazy, with all the wrong corners joining up together. I''m probably missing something really obvious here, but what''s a simple way of avoiding this happening?

unfortunately, there is no simple way to avoid it. you have to dig into topic of clipping ( both 2d and 3d ). first 3dclipping, you have to skip drawing of all polygons ( in wireframe, lines) that are under ( also, above) some certain z value. so if every vertex of polygon lies under this value, dont draw it. now, with polygons that are partially "behind camera", you have to do 2d clipping, which is a lot nastier. im not going to describe it here, theres a lot of tutorials on that, but the idea is not to draw the part of the polygon that is under that z value.

Share this post


Link to post
Share on other sites
NeilArrow    122
Hmmm. I kind of expected that to be the answer.

Thanks for your help. Hopefully i''ll be back with a stupid question about binary space partitioning in a few months...

Neil

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Hmmm. I kind of expected that to be the answer.

Thanks for your help. Hopefully i''ll be back with a stupid question about binary space partitioning in a few months...

Neil

Share this post


Link to post
Share on other sites
NeilArrow    122
Hmmm. I kind of expected that to be the answer.

Thanks for your help. Hopefully i''ll be back with a stupid question about binary space partitioning in a few months...

Neil

Share this post


Link to post
Share on other sites