08-14-2014, 05:11 PM
This is easy. The rectangle is created at the four points generated by half-width/height off the center, so you'd have to shift the vertices by heigth/2, so
becomes
or in general:
Code:
new Vector3(-w2,h2,0)
becomes
Code:
new Vector3(-w2,0,0)
or in general:
Code:
var offset=new Vector3(0,h2,0);
new Vector3(-w2,h2,0)-offset
...