« Return to Thread: Camera FoV
I can't give you a code example but I'll give you the scenario.
I have renderers implemented in Directx and OpenGL that output renders (images) to me.
In these renderers I can set any value as diagonal field of view to the camera.
What I wanna do is to use a low poly version of my 3d models in papervision, so the user can set the camera position in the scene, click on a button to render and I output an image of the same scene rendered using high poly 3d models on my renderers.
The default diagonal FoV that I use in the renderers is 25. The flash stage and the output image have the same size 622x310. I could synchronize the papervision camera with my renderers using the following formula to find the papervision camera focus:
var diagonalFOV:Number = 25;
var width:Number = 622;
var height:Number = 310;
var w:Number = width;
var h:Number = height;
var d:Number = Math.SQRT((w * w) + (h * h)) ;
var focalDistance:Number = d * Math.TAN(diagonalFOV / 2.0) ;And I had to manually adjust the papervision camera zoom until it matches the rendered images.
I have the following questions:
1) Does the papervision camera focus represent the focal distance that we find in any standard 3D game library (DirectX/OpenGL) for camera settings?
2) How can I calculate automatically the papervision camera focus and zoom if I give you as input my stage size and diagonal field of view?Thank you,
Marcelo Muniz
From: Papervision3D-bounces@... [mailto:Papervision3D-bounces@...] On Behalf Of Peter Kapelyan
Sent: terça-feira, 12 de junho de 2007 20:57
To: Papervision3D@...
Subject: Re: [Papervision3D] Camera FoV
Ok I am back - can you send me any code (hopefully flex as3 or cs3)?
I will try to give you a good answer!
-Pete
On 6/12/07, Marcelo Caetano Martins Muniz <marcelo@...> wrote:
Ok. I'll be waiting for you response.
From: Papervision3D-bounces@... [mailto:Papervision3D-bounces@...] On Behalf Of Peter Kapelyan
Sent: terça-feira, 12 de junho de 2007 15:30
To: Papervision3D@...
Subject: Re: [Papervision3D] Camera FoV
Hi someone posted a calculator or something (my suggestion). I will look tonight - literally out the door now.
-Pete
On 6/12/07, Marcelo Caetano Martins Muniz <marcelo@...> wrote:
Hi,
I still got no answer about how to calculate the camera Field of View using focus and zoom.
I did some research and I find out how to calculate focalDistance, is it the same as the camera focus?
Here is formula I found how to convert diagonalFOV to focalDistance.
var diagonalFOV:Number = 25;var width:Number = 622;
var height:Number = 310;
var w:Number = width ;
var h:Number = height ;
var d:Number = Math.SQRT((w * w) + (h * h)) ;
var focalDistance:Number = d * Math.TAN(diagonalFOV / 2.0) ;
If focalDistance is the same as the camera focus, it still doesn't make sense how to calculate the correct camera zoom for one selected FoV.
Does anyone have some clue to this puzzle?
Thanks,
Marcelo Muniz
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
« Return to Thread: Camera FoV
| Free embeddable forum powered by Nabble | Forum Help |