How to fully fit a plane in the viewport

Software: Away3D 4.x

Avatar
jansensan, Newbie
Posted: 06 February 2012 03:40 PM   Total Posts: 16

I recently had to fit a plane fully in the viewport and it took me a while to figure it out. It may be obvious to some of you, but for those of us for whom it is not, I wrote a tutorial. Enjoy!

http://jansensan.net/how-to-fully-fit-away3d-plane-in-viewport

   

John Brookes, Moderator
Posted: 06 February 2012 05:04 PM   Total Posts: 732   [ # 1 ]

On the getter for the camera angle
use
PerspectiveLens(view.camera.lens).fieldOfView

eg
var maxheight:Number = Math.tan((PerspectiveLens(view.camera.lens).fieldOfView * 0.5) * Math.PI / 180) * dist*2;
var maxWidth:Number = maxheight * (view.width / view.height);

Assuming you are using the perspective lens.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X