Sorry..
That should have been
var w:Number
= container.width / 2; // half the width of the container in which the scene
is being rendered
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:Number
= container.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;
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