CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 07-05-2012, 11:28 PM   #1
New Member
Jason Hayes
San Marcos, USA
Join Date: Jul 2012
Posts: 1
Match camera fov to rectangle

Given a rectangle, how would I match a camera's fov to fit exactly? I'm setting the render width and height to match the size of the rectangle, but the FOV of the camera doesn't match. This needs to be an orthographic projection.

Old 07-10-2012, 03:35 PM   #2
Josh Jones
Lead Animator
Bethesda Game Studios
Join Date: Mar 2003
Posts: 144
You'll need to use some trig.

You'll need to calculate the horizontal angle of the camera based on the rectangle's width and its distance from the camera. I.e. take the Tangent of the (width/2)/distance, since as we remember from high school algebra, tangent is opposite/adjacent.

horizontal FOV = 2*tan((rectangle.width*0.5)/camDistance)

Note: this is all from memory and untested, so someone please correct me if my math skills are a bit rusty.
Old 07-10-2012, 05:09 PM   #3
Join Date: Dec 2002
Posts: 495
maybe: horizontal FOV = 2*atan((rectangle.width*0.5)/camDistance)
Old 07-10-2012, 05:09 PM   #4
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:11 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.