When can the Camera see Me?

Posted By: Night Viper

When can the Camera see Me? - 05/15/07 17:21

I'm looking for a quick and easy way to tell if a vector or invisible model is within the camera viewpoint. That way I can start an action only when it is not visible from the camera view.

Can this be done without having to compare the model's and camera's x/y coordinates and thier distance to each other, and then comparing that with the camera's angle and taking into account the camera's arc? That just seems overly complicated. Or maybe there's a good algorithm that takes all this into account in just a few lines. Any ideas?
Posted By: HeelX

Re: When can the Camera see Me? - 05/15/07 17:39

Quote:

entity.clipped

Tells wether an entity is was clipped away by the culling process during the last frame. Can be evaluated for running entity functions - for instance, particles - depending on whether the entiy is potentially visible or not.



Posted By: tompo

Re: When can the Camera see Me? - 05/15/07 22:33

if (vec_to_screen(model.x,camera))
0 - Result is outside the view.
1 - Result is inside the view.
Posted By: Night Viper

Re: When can the Camera see Me? - 05/16/07 04:41

Thanks for the help, I've got it worked out.
© 2024 lite-C Forums