I am experimenting with different matrices, studying their effect on a textured quad. So far I have implemented Scaling, Rotation, and Translation matrices fairly easily - by using the following method against my position vectors:
However, I what I want to do is be able to position my vectors using world-space coordinates, not object-space.
At the moment my position vectors are declared thusly:
[source lang="csharp"] myVectorPositions = new Vector3(-0.1f, 0.1f, 0.5f); myVectorPositions = new Vector3(0.1f, 0.1f, 0.5f); myVectorPositions = new Vector3(-0.1f, -0.1f, 0.5f); myVectorPositions = new Vector3(0.1f, -0.1f, 0.5f);[/source]
On the other hand (and as part of learning about matrices) I have read that I need to apply a matrix to get to screen coordinates. I've been looking through the SlimDX API docs and can't seem to pin down the one I should be using.
In any case, hopefully the above makes sense and what I am trying to achieve is clear. I'm aiming for a simple 1024 x 768 window as my application area, and want to position a my textured quad at 10,10. How do I go about this? Most confused right now.
With SlimDX you can use Matrix.OrthoOffCenterLH()/Matrix.OrthoOffCenterRH() to create an orthographic projection matrix for a given set of screen dimensions (LH/RH specifies left-handed/right-handed coordinate systems). Whatever you specify as left becomes the x coordinate for the left side of the screen, right becomes the x coordinate for the right side of the screen, etc.
I'm not sure if my matrix definition is correct though, or my idea about how to use it is correct. I've interpreted the left and right parameters to mean the minimum and maximum X screen coordinates. Is that correct?