Camera maths

Blitz3D Forums/Blitz3D Programming/Camera maths

poopla(Posted 2004) [#1]
How would one find the size of the viewing rectangle(X/Y coords in the camera's local system) at a certain distance ahead of the camera. I know it's based off the cameras zoom/aspect ratio, but I don't want to just understand a the blitz method of doing so, as I don't know if it's essentially the same when directly using DX, and oGL, or if it differes alot.


Any help is appreciated.


Mustang(Posted 2004) [#2]
Here's a start:

http://www.blitzbasic.com/codearcs/codearcs.php?code=676

Do the reverse, and once you know the FoV it's pretty simple to calculate the rect points once you know the distance and the field of view in degrees. It's morning here and I'm having only my second cup of coffee so it's best to leave the actual math to somebody who's fully awake :)


poopla(Posted 2004) [#3]
It's actually simpler then that. It's the distance in question from the camera, devided by the camera zoom(in blitz), that returns the width of the viewing space at that distance. The height is then simply 3/4 of that value.

Thanks for the link though, it got me thinking.