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.
Show differencesHistory of post edits
#3MarkS
Posted 14 November 2012 - 02:59 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.
#2MarkS
Posted 14 November 2012 - 02:58 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 this 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 this will be universal to any rendering API.
#1MarkS
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.
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.