View Full Version : how to draw lines?
to draw lines moving from left to right and vice versa, up to down and vice versa?
please help with the code?
You can do it the same way you draw any primitive in OpenGL :
glBegin(...) and glEnd().
For lines you can use
x1,y1 are the start position and x2,y2 are the end, assuming you are only doing 2D drawing.
Find the redbook examples somewhere they have all of this stuff and more in it.
10-17-2000, 06:39 AM
If you want to move the lines just define a delta for each coordinate that will be added each frame. For instance:
delta = 1.0;
x1 += delta;
x2 += delta;
Then just use the code form the previous reply.
In this case the line will move from the left ot the right. The variable delta controls the speed, the higher the value the faster the line moves.
Antonio www.fatech.com/tech (http://www.fatech.com/tech)
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.