How do we know if an object is visible or not ?

Started by
10 comments, last by jolyqr 18 years ago
Never dealt with this but here's an idea --

Transform the viewing frustrum to the NPCs eyes - and do some sort of testing with that?
AfroFire | Brin"The only thing that interferes with my learning is my education."-Albert Einstein
Advertisement
Quote:Original post by jyk
Quote:Original post by jolyqr
six objects, maybe, no more. it's not going to be a huge game. it's more like a demo.
In that case, don't worry about broad-phase culling, spatial partitioning, or anything like that. Just write functions to test for the intersection of a ray with the object types you're interested in (e.g. boxes and pyramids), and when you need to raytrace, just trace against every object in the scene.

There are different algorithms for raytracing various objects, but speed won't be an issue here, so I'd just find something that works and go with it. Things to google for would be 'raytrace box', 'ray box intersection', 'ray AABB intersection', 'ray OBB intersection', 'ray triangle intersection', and similar phrases.


thanks a lot !!

This topic is closed to new replies.

Advertisement