Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: how to draw a line ?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    4

    how to draw a line ?

    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 .


  2. #2
    Intern Contributor Brokenmind's Avatar
    Join Date
    Feb 2014
    Location
    Aachen / Germany
    Posts
    71
    The general syntax is:
    Code :
    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 (look at the images ). If you still have problems then, maybe you can make some picture of how your problem looks like.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    4
    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 Click image for larger version. 

Name:	images3.jpg 
Views:	30 
Size:	8.7 KB 
ID:	1267

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    4
    i hope u understand what im trying to say .

  5. #5
    Intern Contributor Brokenmind's Avatar
    Join Date
    Feb 2014
    Location
    Aachen / Germany
    Posts
    71
    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.

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2014
    Posts
    4
    Thank u brokenmind

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •