Is Object in Camera View?
elaidaomar
Posts: 6
How can I check whether an object is in a camera's field of view (return boolean)?
You currently have no notifications.
How can I check whether an object is in a camera's field of view (return boolean)?
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.
Comments
Unless there's a function to do it, I believe you're stuck doing the math. If you know the direction you're facing and the field of view angle, you should be able to calculate the direction to each of the points in the bounding box of the object in question. My linear algebra is too weak to give efficient equations, but you should be able to do it with trigonometry.
Edit: DzBox3::testIntersection will probably get you most of the way there in combination with the methods in Dz3DViewport
mCasual has a script that you could look at to probably give you some clues. I'm not sure if/how that would translate to the SDK, though.