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]
Orthogonal Projection and Translation
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:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement