PDA

View Full Version : how to draw a line ?



Coming from afar
04-19-2014, 12:29 PM
Hi ,

please i want to ask , how can i draw a line in openGL?

i have a project to submit in these days but i dont know how to draw the picture that i chosed..its a horse and when i apply the function LINE_Stripple

its not look good .

:(

Brokenmind
04-19-2014, 03:13 PM
The general syntax is:

glBegin(GL_LINES) or (GL_LINE_STRIP) or (GL_LINE_LOOP);
glVertex2f(x, y) or glVertex3f(x, y,z);
...
glEnd();
You can look for what best suits your needs here (http://wiki.delphigl.com/index.php/glBegin) (look at the images ;) ). If you still have problems then, maybe you can make some picture of how your problem looks like.

Coming from afar
04-19-2014, 03:46 PM
Thank you Brokenmind , i already know this structure ... hmmmmm i mean if i want to draw a horse but make it natural not just lines .

this is my picture 1267

Coming from afar
04-19-2014, 03:54 PM
i hope u understand what im trying to say .

Brokenmind
04-20-2014, 02:16 AM
Do you simply want to draw your horse no matter what (as a picture), or do you explicitly want to convert it into lines and draw them afterwards? I'm afraid the latter is no easy task and I have no idea how to do it. The former can be achieved with the use of textures, as shown here (http://www.nullterminator.net/gltexture.html).

Coming from afar
04-20-2014, 02:08 PM
Thank u brokenmind :)