« Return to Thread: Convert PV3D zoom / focus to Field of View ?

Re: Convert PV3D zoom / focus to Field of View ?

by aaron haines :: Rate this Message:

Reply to Author | View in Thread

Sorry..
 
That should have been
 
var w:Numbercontainer.width / 2; // half the width of the container in which the scene is being rendered


From: papervision3d-bounces@... [mailto:papervision3d-bounces@...] On Behalf Of Aaron Haines
Sent: 13 November 2007 17:17
To: papervision3d@...
Subject: Re: [Papervision3D] Convert PV3D zoom / focus to Field of View ?

 
Here's the solution we arrived at to calculate horizontal Field of View from camera focus / zoom
We're using it to match up a PV3D scene with a server side render engine.
 
Basically all we are doing is working out the X position of the edge of the container in the 3D projection and then calculating the angle from the camera positon
 
Seems to work pretty well.
Hope it's of use to people.
 
-----------------------------------------

var f:Number = camera.focus;

var z:Number = camera.zoom;

var w:Numbercontainer.width; // width of the container in which the scene is being rendered

var d:Number = cameraDistanceZ; // Z distance of camera from 0 along it's axis - camera.z might work just as well

var r:Number = 180 / Math.PI;

var fov:Number = Math.atan(((((f - d) / f) / z) * w) / d) * r * 2 * -1;



From: papervision3d-bounces@... [mailto:papervision3d-bounces@...] On Behalf Of Aaron Haines
Sent: 01 November 2007 15:06
To: papervision3d@...
Subject: [Papervision3D] Convert PV3D zoom / focus to Field of View ?

Hi
 
Can anyone tell me how to convert the papervision camera zoom and focus into a field of view value in degrees ?
 
Thanks
a.
 

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

 « Return to Thread: Convert PV3D zoom / focus to Field of View ?