PDA

View Full Version : Clipping



RandyU
05-12-2001, 10:43 PM
What is the best way to clip objects before drawing?
I thought about clipping two volumes defined by arbitrary planes, but it appears to be too complicated.

Frumpy
05-13-2001, 06:24 PM
If you're using a nVidia card let the card do all the clipping. You should do object culling, backface culling and if you feel like it frustum culling.

RandyU
05-13-2001, 07:10 PM
I'm speaking about clipping geometry by frustum volume before sending to card.
I know how to clip one point(translate it to normalize device coordinates). But how to do this with more complex objects? Bound them by sphere? Or by box?

Stormie
05-14-2001, 03:19 AM
Originally posted by RandyU:
But how to do this with more complex objects? Bound them by sphere? Or by box?

What shape is the complex object? If it's sort of round, then bound it with a sphere. If it's long and thin, a box would be better (because a sphere would be much bigger than is optimal, to enclose a long thin object)

RandyU
05-14-2001, 04:45 AM
I'm implementing abstract class system, so I dont know what kind of objects will I have. I think I'll bound them by convex multihedron defined by vertices. But I just have no idea how to check if it lies inside of viewing volume.

ffish
05-14-2001, 05:46 AM
Being a frequent contributor, I'm surprised you haven't come across this link before http://www.markmorley.com/opengl/frustumculling.html Should have everything you need.

Hope that helps.