Results 1 to 3 of 3

Thread: Drawing a circle in pixels

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    4

    Drawing a circle in pixels

    Hello,

    I'm trying to draw a 50x50 circle (with a transparent background) using glDrawPixels(). There's nothing in the Red Book that shows how I can do this. Any ideas?


    thanks.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,662

    Re: Drawing a circle in pixels

    With a fiew maths and an orthographic view simply apply the circle maths equation.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Drawing a circle in pixels

    Hmmm, why use glDrawPixels ? and if you are then I assume you already have your circle some where in a buffer and want to draw it ? then just have a look at the documentation for glDrawPixels.
    glDrawPixels

    The alpha value in your buffer is used for transparent pixels.

    If you need help with the actual circle I suggest that you dig up your old math book from school and have a peek, you might even find it in the documentation for cos() and sin() functions.

    But I would suggest you render the circle with glBegin( GL_LINE_STRIP) instead.

    Mikael

Similar Threads

  1. Drawing a circle
    By imported_onorinbejasus in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-20-2010, 04:01 AM
  2. Drawing circle with c++
    By satekazumi in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-01-2009, 06:37 AM
  3. drawing a circle
    By fox in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 09-08-2001, 07:05 PM
  4. drawing circle
    By prabhat in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-25-2000, 09:36 AM
  5. drawing a circle
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-21-2000, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean