PDA

View Full Version : The Camera, FOV, Aspect Ratio



pbergeron
28-Aug-07, 22:14
I apologize in advance if this is not the right forum for this post. I created a simple scene (cube with a plane inside of it). The plane has a texture on it. That is it.
I render the scene to a jpg using all of the defaults - modeling using a right-handed system (z towards screen, y up). As I understand it you can calculate the FOV value using the camera's lens value as follows:
fov = 2 * atan(16.0 / lens )
i can take this fov value and use it to set-up the perspective matrix in XNA. Note that both my Blender and XNA settings are using an aspect ration of 800/600.
I also constrain the camera (in Blender) to a empty located in the scene. I grab the position of the camera, the "look at" point and use that in XNA to build the view matrix.
So, I would have assumed that the 2 rendered scenes would line up perfectly. But they do not. I attached a screen shot. the semi-transparent image is the blender output and the other image is the screen shot of the XNA output. As you can see, they are not rendered the same.
Does anyone know what else I may be missing? Any help would be wonderful. I am stumped. BTW, I used the FBX exporter.
http://i17.photobucket.com/albums/b95/julesthe/scene1-1.jpg

delic
29-Aug-07, 04:43
use directly the FOV value from blender camera ! Click the button just right of the lens value .

pbergeron
29-Aug-07, 19:27
Thanks. Is this a new button in 2.44? I have not used Blender since version 2.42 and I cannot recall this button. Thanks for that tip!