Objects with holes in OpenGL?
Hi all.I would like to know how could I draw objects with "holes" in OpenGL. Eg:I know how to draw a cube in OpenGL, but How could I make a "hole" in the cube for example a "triangular" hole and on this way I could "see" trhought this hole...?
Tnx in advance for any help...
The object with the hole would need to be modeled that way. It would have lots of tri's.
That picture would be the front and back of your cube. Cutting that into tri's will give at least 5 polys. So your complete cube with a triangular hole in it would have
4 - the sides.
10 - front and back.
6 - sides of the hole.
For a grand total of 20 triangles... A bit more than you thought, huh?
Later,
Landsknecht
[edited by - landsknecht on March 21, 2002 5:54:53 AM]
-----------------| -------- || \ / || \ / || \ / || \/ |-----------------
That picture would be the front and back of your cube. Cutting that into tri's will give at least 5 polys. So your complete cube with a triangular hole in it would have
4 - the sides.
10 - front and back.
6 - sides of the hole.
For a grand total of 20 triangles... A bit more than you thought, huh?
Later,
Landsknecht
[edited by - landsknecht on March 21, 2002 5:54:53 AM]
ok tnx for the info, please: Do you know where could I find some "sample code" regarding this matter of objects with holes?
Tnx again...
Tnx again...
The best thing you could do is stop thinking about it the way you are. You ''object with hole'' is only a mesh model. Fing a tutorial to do meshes and you have your answers...
Landsknecht
Landsknecht
look into boolen subtraction and union of meshes. this is used in 3d apps to subtract or weld two objects into one.
This may help...
A CRPG in development...
Need help? Well, go FAQ yourself.
"I''m gay, please convert me." - Nes8bit
A CRPG in development...
Need help? Well, go FAQ yourself.
"I''m gay, please convert me." - Nes8bit
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement