• FEATURED

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

## XMMatrixOrthographicLH Question

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Ralara  Members

Posted 14 January 2013 - 03:02 PM

Quick question regarding the use of the XMMatrixOrthographicLH function.

After spending several days trying to figure out why I couldn't render any 2D objects in my game I finally realised I had the incorrect inputs to this function (all fixed and working now!), I'm just unsure why my original inputs were wrong.

I currently have a camera with a near z of 0.1 and a far z of 1500 just as default but when using these values to create the orthographic matrix nothing would be rendered on screen. I now use the same function but with values of 0 and 1 respectively and everything works.

If someone could explain that would be appreciated as documentation / google searches just say that the near z and far z values are required.

Thanks!

### #2MJP  Moderators

Posted 14 January 2013 - 06:19 PM

What was the Z value of the vertices for your 2D objects? Perhaps the Z was getting set to 0, and they were getting clipped?

### #3Ralara  Members

Posted 15 January 2013 - 03:15 AM

Ah, turns out my Z was getting set to 0 and I hadn't noticed! I can't test my code right now but if I change it so the vertex Z is set to the near Z and use my original values, would I be correct in assuming it would work?

Thanks for your response though, makes a lot of sense. Always the simplest things that can be the hardest to spot when they are right in front of you  !!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.