Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Orthogonal Projection and Translation

This topic is 5564 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 all, I've been trying to draw a 2D primitive using a static vertex buffer, untransformed vertices and orthogonal projection. This is working fairly well, and I am moving the quad quite well by updating the world matrix. However, using the formula below, I'm not getting exact screen-to-space coordinates. I'm drawing the quad where the mouse coordinates are, however I'm also drawing an "X" using CD3DFont. The quad I'm rendering moves further up from the "X" as I move the mouse down. It doesn't get very far, but I can tell that it's not being drawn at the exact mouse coordinates, which is quite annoying. Is there anyway I can get more precise coordinates using untransformed vertices? Formula:
float x = Input->GetMouseX() - GetWindowWidth() / 2;
float y = -Input->GetMouseY() + GetWindowHeight() / 2;
Thanks in advance! [edited by - fuzztrek on September 24, 2003 8:51:53 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!