0

I need to convert <-1;1> to x y coordinations to draw a triangle on screen.

vertices[0].Position = new Vector3(-0.5f, -0.5f, 0f);

How can I convert x y to that float number precisely?

  • What is <-1;1> for kind of type? Is it a string? And why does -1;1 convert to -0.5, -0.5, 0 ? – rene May 01 '14 at 09:26
  • Rather than manually calculating positions/offsets by hand (read: in software), properly set your view/projection/model matrix to do the conversation for you. – Mario May 01 '14 at 09:28
  • I am using 2d textures and sorry for not being clearly, it meant that x y must be between -1 to 1 and I want to use the full coordinations – user3589439 May 01 '14 at 12:27
  • Use a projection matrix – Blau May 02 '14 at 22:32

0 Answers0