Advertisement

Fit scene into camera frustum

Started by June 29, 2021 03:52 PM
0 comments, last by FonzTech 3 years, 2 months ago

Hi at all. I'm trying to figure out how to fit my game scene into the camera frustum.

I understand that I must extract the rectangle at position Z from the frustum, where Z is the distance from camera to the eye target point. Then this rectangle, which has well defined vertices, must match my rectangle which I want to fit (which should be the scene).

Now, my concerns are about how this builds up with the viewport size. Should I project them into screen space?

So, the question is:

  • How can I fit a rectangle (given its vertices) exactly into my camera viewport?

Thanks in advace?

This topic is closed to new replies.

Advertisement