A little math help

BlitzMax Forums/MiniB3D Module/A little math help

ima747(Posted 2010) [#1]
My brian is refusing to accept this problem for some reason, perhaps someone else can lend a hand...

I have an object of a set width, I need to know how far back to move the camera to fit all of the object on screen at once, taking into account the screen aspect ratio...

sorry to post a lame math question here but I figured the solution would help someone else as well at some point.


_Skully(Posted 2010) [#2]
I think your going to have to do some cameraprojections to figure that out... I don't think its as easy as a calculation

you could do a camera project from the left, and another from the right side of the object.... and then move the object back or closer until you hit the sweet spot..

I think you would have to do an updateworld between iterations

However, I could be wrong.