🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Fit scene into camera frustum

Started by
0 comments, last by FonzTech 2 years, 11 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