Objects with holes in OpenGL?

Started by
4 comments, last by John2002 22 years, 1 month ago
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...
Advertisement
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]
My sig used to be, "God was my co-pilot but we crashed in the mountains and I had to eat him..."
But folks whinned and I had to change it.
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...
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
My sig used to be, "God was my co-pilot but we crashed in the mountains and I had to eat him..."
But folks whinned and I had to change it.
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
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi

This topic is closed to new replies.

Advertisement