hi guys i am bit new to this opentk in mono and i am trying to port my game to this ios and android both using mono develop but i kind of stuck looking in to this opentk api stuff could you please tell me how to draw a 2dquad with width and height between two points please
drawing a 2D quad between 2 points in opentk ?
Started by rakeshkr590, Nov 14 2012 08:31 AM
2 replies to this topic
Sponsor:
#2 Members - Reputation: 591
Posted 14 November 2012 - 02:55 PM
I don't know OpenTK, but defining a quad via two points is easy:
x1,y1.......??,??
......................
......................
......................
??,??.......x2,y2
The two missing points are defined as:
x2,y1 and
x1,y2.
So the quad, in CCW order would be:
x1,y1,
x1,y2,
x2,y2,
x2,y1.
If you only know the one set of coordinates and the width and height,
x2 = x1 + width
y2 = y1 + height.
Someone else will have to show you how to translate that into OpenTK commands, but the above will be universal to any rendering API.
x1,y1.......??,??
......................
......................
......................
??,??.......x2,y2
The two missing points are defined as:
x2,y1 and
x1,y2.
So the quad, in CCW order would be:
x1,y1,
x1,y2,
x2,y2,
x2,y1.
If you only know the one set of coordinates and the width and height,
x2 = x1 + width
y2 = y1 + height.
Someone else will have to show you how to translate that into OpenTK commands, but the above will be universal to any rendering API.
Edited by MarkS, 14 November 2012 - 02:59 PM.
#3 Members - Reputation: 121
Posted 15 November 2012 - 06:20 AM
thanks for the reply mark here the problem is not about the maths sorry for not explaining properly its about the opentk stuff i was after . no worries i am finding my way out
happy coding .
happy coding .
Edited by rakeshkr590, 15 November 2012 - 06:22 AM.






