views:

205

answers:

1

I am working on a 3D flip control that can flip horizontally, vertically and can have any size and square or rectangular shape.

While I have it working, I ran into a very odd issue with the perspective camera. When I create a MeshGeometry3D I scale to the proper ratio of the content. If the width > height, all is well. However, if height > width, then the 3d mesh is sized too small.

The only thing that fixed this was (if height > width) change the UpDirection on the perspective camera from 0 1 0 to 1 0 0 and apply a 90 rotate transform. When I do this, everything looks perfect.

Anyone know why this is? Does the perspective camera only take width into account when sizing the mesh?

Thanks!

A: 

Try to play with the FieldOfView property. That's the angle at which the scene is "seen" by the camera. In your case multiplying the ratio by height / width without changing the FoV should suffice.

Julien Lebosquain
Gave it a shot, but couldnt figure out what the proper angle is- if default angle is 90, and height is 400, width 200 then I thing the angle should be about 57 (using some very rusty trigonometry!). But the mesh is not quite exact... ?
Nicros