sgt_pinky Posted January 9, 2005 Posted January 9, 2005 (edited) Hi, I just have a basic 'View Mesh' application, so that you can view a mesh, rotate it, etc. I want to have a check box that allows me to turn off perspective, but I can't get the projection to work. At the moment I have: dRender.Transform.Projection = Matrix.PerspectiveFovRH(CSng(Math.PI) / 4, fAspect, objectRadius / 64.0F, objectRadius * 200.0F) I have tried Matrix.OrthoRH, but without any success. Any suggestions? Cheers, Pinky Edit: Ok, I managed to get the projection to work with: dRender.Transform.Projection = Matrix.OrthoRH(fTarget.Width, fTarget.Height, objectRadius / 64.0F, objectRadius * 200.0F) I am just using the arcBall provided in the SDK to rotate the mesh. I am having trouble zooming now, in Orthographic projection. It just changes the zplane, and ends up cutting the mesh in half. This is how I set my View Matrix: Dim vFrom As New Vector3(0, 0, 3 * objectRadius) Dim vAt As New Vector3(0, 0, 0) Dim vUp As New Vector3(0, 1, 0) dRender.Transform.View = Matrix.LookAtRH(vFrom, vAt, vUp) That works fine for Perspective, but not Orthographic. Edited January 9, 2005 by sgt_pinky Quote
IngisKahn Posted January 10, 2005 Posted January 10, 2005 To zoom in ortho mode you need to divide your height and width by your scale factor. Quote "Who is John Galt?"
sgt_pinky Posted January 10, 2005 Author Posted January 10, 2005 Aha! Thanks Ingis. First post too - very generous of you :D And, yes....I feel stupid... :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.