Jump to content
  • Advertisement
Sign in to follow this  
cptrnet

What do I need to do to Translate Z?

This topic is 4829 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

Hello, I am using c# and managed directx, but I know it is the same in c++ and unmanaged. I can translate in x and y just fine, but I am having trouble with z. I try to do it and it just disappears. I have turned on Zenable in the render state. I was thinking it might be my matrix multiplication. I first multipy the scale and the rotation, then that by the translation to get my world transformation. Is there something I am missing?

Share this post


Link to post
Share on other sites
Advertisement
I think I figured it out, I was using an orthographic view, but even that has a znear and a zfar. anyway I changed it to a perspective view with a view looking at the center and now the z translates. Is there a reason I can't do it with an orthographic?

Share this post


Link to post
Share on other sites
As far as I know the orthognal view is used for displaying a 2D scene, thus only the x,y axes are used. The z values has the same purpose like in a perspective view, though in an orthognal view the z axis has no effect on an object's size (unlike the perspective view which reduces object's size depending on how far it is). You can use z values with your objects in an orthognal view to specify if an object should be drawn before or after other objects. (Using the ZEnable flag)

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!