« Return to Thread: Camera FoV
Now it makes sense. I’ll
take a look at the papervision API implementation and try to figure out how
they are implementing focus and zoom.
From:
Papervision3D-bounces@... [mailto:Papervision3D-bounces@...] On Behalf Of Peter Kapelyan
Sent: quarta-feira, 13 de junho de
2007 00:34
To: Papervision3D@...
Subject: Re: [Papervision3D]
Camera FoV
Ok well, I tried a test like this...
nnn++;
if(nnn%5){
//#1
camera.z=-1000;
camera.zoom=2;
}else{
//#2
camera.z=-15500;
camera.zoom=20;
}
Just so I can see distortion, and indeed zoom does cause alot of distortion
even if the get the object in the same place, another will be distorted.
So I take back what I said about the ZOOM not doing much, it seems to be
distorting stuff.
In scenario #1, the sphere in helloworld looks like a egg shape
pointing at you, however in scenario #2, the Space background nearly match, but
the sphere is a perfect sphere - because it is being viewed from afar.
There has to be a calculation then - I am almost certain of it - I was thinking
of trying myself, but I don't have a project to work on that needs it, yet :)
-Pete
On 6/12/07, Peter
Kapelyan <flashnine@...>
wrote:
Hi
I was saying to consider the fact since ZOOM basically moves the camera
closer - perhaps you can look at what ZOOM does in the code, but my feeling is
that it simply just moves the camera closer - and focus accounts for the
"fish eye" etc.
If you figure out that ZOOM may just be the same as bringing the camera
close - maybe that will help you figure it out?
-Pete
On 6/12/07, Marcelo
Caetano Martins Muniz <marcelo@...> wrote:
If you use DirectX for example, the FoV
has a big rule in the camera Zoom.
Generally people use 45 as diagonal FoV, but if you change from 45 to 25 the
object will look closer.
Check the attached images, both images the camera is at the same distance from
the object, the only difference is the Field of View.
When I use papervision, if I just change
the camera focus the objects won't look any closer. I see the projection
difference but no zoom difference.
So, I think that if I want to synchronize
DirectX or OpenGL camera with Papervision3D I'll have to change both focus and
zoom. And that's why I'm after a formula that gets as input the scene stage
size and diagonal field of view and return the papervision focus and zoom.
Does it make sense to you?
Thanks,
Marcelo Muniz
From: Papervision3D-bounces@...
[mailto:Papervision3D-bounces@...] On
Behalf Of Peter Kapelyan
Sent: terça-feira, 12 de junho de
2007 21:54
To: Papervision3D@...
Subject: Re: [Papervision3D]
Camera FoV
Hi, I
seriously DOUBT it because it is not truley 3d...however I am sure it comes
very close.
Also I realize you maybe have answered your own question! I don't think zoom
will help you because I believe it in effect the same as moving the camera
closer to the focal point, so it almost seems like zoom might not play a part
in your scenario unless maybe you convert it to a Z position? Just an idea.
-Pete
On
6/12/07, Marcelo Caetano Martins Muniz
<marcelo@...> wrote:
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 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. |
|
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
_______________________________________________
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 |