drawLine with angle and length

Started by
1 comment, last by Yel 21 years, 9 months ago
Hi all ! can anybody tell me if there is a direct method in openGL to draw a line using a starting point and an angle the length ?? all hints are very much appreciated Yel
Advertisement
I think, there is no method to draw lines with angle and length... Maybe some of the support libraries (glu, glaux, glut) does that.
You can calculate in on your self, so you get two points.

PM
PM Times change...Excuse my poor english!
Make your own function:

This is what you got:

X1 = 15
Y1 = 30
Angle = 1.23 <-- in radians (360 degrees = 2*PI radians)
Length = 50


Then calculate what you need:

X2 = X1 + Length * cos(Angle)
Y2 = Y1 + Length * sin(Angle)


Now draw a line between (X1, Y1) and (X2, Y2).
______________________Haydel

This topic is closed to new replies.

Advertisement