Jump to content

  • Log In with Google      Sign In   
  • Create Account


drawing a 2D quad between 2 points in opentk ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 rakeshkr590   Members   -  Reputation: 121

Like
0Likes
Like

Posted 14 November 2012 - 08:31 AM

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

Sponsor:

#2 MarkS   Prime Members   -  Reputation: 882

Like
0Likes
Like

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.

Edited by MarkS, 14 November 2012 - 02:59 PM.


#3 rakeshkr590   Members   -  Reputation: 121

Like
0Likes
Like

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 .

Edited by rakeshkr590, 15 November 2012 - 06:22 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS