view_check and frustum

Posted By: Wjbender

view_check and frustum - 05/25/15 09:16

is it possible to have view_check limited to only pan angles , what I mean is I have the position and bound extends of entities and I need to only use those (fully visible) within the frustum , so I use the center points on a view_check for the camera , it works great and saves me un needed iterations in my project , but I need the view_check to disregard tilt angles such that no matter what camera tilt is that my points wil always be visible ,only their x and y position will be changing within the frustum and pan angles will then determine if those positions are in frustum ,is that possible ?

I have tried rotating the positions so that no matter the tilt angle ,the positions should stay visible in front of the frustum , but I think I messed up with their pan angles , I will check again .

any other advice on checking for x and y in the frustum and keeping the z visible ?

Posted By: Superku

Re: view_check and frustum - 05/25/15 09:39

You can write a view_check function yourself using vec_dot, planes and normals.

Assume you have the normal of a plane (read: one side of the view frustum) pointing outside, then check
d = vec_dot(pos,normal) - vec_dot(camera.x,normal);
for all bounding box vertices/ their positions "pos". If d is negative for one of them, repeat the same process with the other 3 relevant view frustum planes. If one of the d values is negative for all 4 planes, the entity's bounding box intersects the view frustum.
© 2024 lite-C Forums