Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by sgt_pinky

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...