How to find out if a vertex is visable
Hello everybody
Is there a way of testing to see if a 3D point is in front of the camera. I supose I could do some matrix maths but apart from being slow i would not be able to take the perspective into account.
What your looking for is frustum culling. www.gametutorials.com has a good tutorial on it.
quote:
Original post by moogle33
I supose I could do some matrix maths but apart from being slow i would not be able to take the perspective into account.
Doing the maths properly should only amount to a couple of matrix multiplies and (up to) 6 plane equation tests. All these operations are pretty simple and won''t take long at all. By taking the projection matrix into account you can make sure the affect of perspective is applied as well.
Its only going to be slow if you''re comparing millions of points at a time, which you shouldn''t be doing in the first place because you probably want to test and objects bounds first (and maybe leave it no more detailed than that).
A quick and easy route might be to use gluProject and compare the resulting window coord with your window bounds, then you don''t even have to write the maths yourself

[size="1"][[size="1"]TriangularPixels.com[size="1"]] [[size="1"]Rescue Squad[size="1"]] [[size="1"]Snowman Village[size="1"]] [[size="1"]Growth Spurt[size="1"]]
If you are looking for a frustum culling tutorial, I found one by Mark Morley to be really helpful. Unfortunately his site has disappeared, but I saved a copy out of the google cache.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement