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: Q: How to draw an arrow?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Los Angeles, CA, USA
    Posts
    116

    Q: How to draw an arrow?

    Hi,

    Surely I can draw an arrow by drawing one line plus two very tiny short lines. Is there a better way than this naive method? Thanks.

    Tony

  2. #2
    Intern Contributor
    Join Date
    Aug 2000
    Location
    france
    Posts
    89

    Re: Q: How to draw an arrow?

    I don't think there is a gl function help you to draw an arrow
    Using 3 GL_LINES is not a stupid method. If u code in C++, u could create a arrow class.

  3. #3
    Member Regular Contributor
    Join Date
    May 2000
    Posts
    454

    Re: Q: How to draw an arrow?

    Another option is to create a texture with an arrow in it and draw a triangle. Other than this and the 3-line method, I dont really see much else you can do
    Ron Frazier

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: Q: How to draw an arrow?

    If you use GL_LINES, you'll get a very thin arrow for 1 pixel width and very round ends for more than 1 pixel I think. I think to build it out of tris will look the best.
    - Michael Steinberg

  5. #5
    Junior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Los Angeles, CA, USA
    Posts
    116

    Re: Q: How to draw an arrow?

    Thanks for all the replies. You've been very helpful.

    Regards.

    Tony

  6. #6
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Rockhampton, QLD, Australia
    Posts
    1

    Re: Q: How to draw an arrow?

    If you wanted to get particularily tricky, you could draw a Line, and then draw a pretty Cone or pyramid on the end of that.

    I guess its not that tricky compared to everything that you can do with OpenGL, but for arrow drawing, its pretty tricky

    Thats one of the really neat things I think, being able to do so much with a simple concept like arrow drawing.

Posting Permissions

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