StOneDOes Posted March 16 Posted March 16 Not sure if this is a bug or not, but I wouldn't have thought Camera::Project() to behave this way; Using this function to draw an indicator on the screen based on an item in world position. It works correctly when the item is in the camera's field of view, but it also still returns valid screen coordinates when the item is not in the camera's field of view. Is this expected? Quote
Solution Josh Posted March 19 Solution Posted March 19 Camera::Project transforms a position in 3D space into a 2D coordinate on screen, with a third component for the Z axis. The coordinate does not necessarily have to be within the camera frustum. It can be outside the field of view, behind the camera, or beyond the camera's far range. If the z component of the returned value is less than zero (or less than the camera near range, to be more precise) then you can skip 2D drawing. You can also skip drawing if the returned coordinate is far enough outside of the screen rectangle that the object can't be seen. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.