Jump to content
  • Advertisement
Sign in to follow this  
dazscott

orthogonal view matrix

This topic is 4906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am developing an fake isometric game(diamond shape map in Direct3D) and the map looked fine(just base grass tiles), until I added the models to the scene(the perspective makes It look crap). I have switched from using a perspective matrix to a orthogonal matrix, in an effort to keep the models in my scene the same size. However the view of the map now just looks flat. anyone know how I can achieve the isometric look in 3d.

Share this post


Link to post
Share on other sites
Advertisement
I've been messing around with this for a while now but I still cant get it right. here is what i have tried.

this setup gave me the fake iso view, but with perspective

device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4, this.Width / this.Height, 1.0f, 10000.0f);
device.Transform.View = Matrix.LookAtLH(new Vector3(0,0, 40.0f), new Vector3(), new Vector3(1,1,0));




and here is the orthogonal setup that has the diamond shape but appears to be a top down view.

device.Transform.Projection = Matrix.OrthoLH(this.Width / 10, this.Height / 10,1.0f, 10000.0f);
device.Transform.View = Matrix.LookAtLH(new Vector3(0,0, 14.0f), new Vector3(0,0,0), new Vector3(1,1,0));



thanks for the help.

Share this post


Link to post
Share on other sites
Quote:
Original post by dazscott
and here is the orthogonal setup that has the diamond shape but appears to be a top down view.

device.Transform.Projection = Matrix.OrthoLH(this.Width / 10, this.Height / 10,1.0f, 10000.0f);
device.Transform.View = Matrix.LookAtLH(new Vector3(0,0, 14.0f), new Vector3(0,0,0), new Vector3(1,1,0));


thanks for the help.


That is a top down view. Your camera is positioned 14 units above the z=0 plane looking straight down the z-axis. Your up vector provides the 45 degree rotation around the z-axis, but you are still looking straight down. You will need to rotate down away from the z axis to get the angled view simulated by isometrics. You could do some trig to get the correct eye position, or drop the look at call altogether and use simple rotations to build the matrix.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!