Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4060452
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:20:23+00:00 2026-05-20T15:20:23+00:00

There are three main ways I know of to draw a simple circle in

  • 0

There are three main ways I know of to draw a simple circle in OpenGL ES, as provided by the iPhone. They are all based on a simple algorithm (the VBO version is below).

void circleBufferData(GLenum target, float radius, GLsizei count, GLenum usage) {
  const int segments = count - 2;

  const float coefficient = 2.0f * (float) M_PI / segments;

  float *vertices = new float[2 * (segments + 2)];

  vertices[0] = 0;
  vertices[1] = 0;
  for (int i = 0; i <= segments; ++i) {
    float radians = i * coefficient;
    float j = radius * cosf(radians);
    float k = radius * sinf(radians);
    vertices[(i + 1) * 2] = j;
    vertices[(i + 1) * 2 + 1] = k;
  }

  glBufferData(target, sizeof(float) * 2 * (segments + 2), vertices, usage);
  glVertexPointer(2, GL_FLOAT, 0, 0);

  delete[] vertices;
}

The three ways that I know of to draw a simple circle are by using glDrawArray from an array of vertices held by the application; using glDrawArray from a vertex buffer; and by drawing to a texture on initialization and drawing the texture when rendering is requested. The first two methods I know fairly well (though I have not been able to get anti-aliasing to work). What code is involved for the last option (I am very new to OpenGL as a whole, so a detailed explanation would be very helpful)? Which is most efficient?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:20:24+00:00Added an answer on May 20, 2026 at 3:20 pm

    Antialiasing in the iOS OpenGL ES impelmentation is severely limited. You won’t be able to draw antialiased circles using traditional methods.

    However, if the circles you’re drawing aren’t that large, and are filled, you could take a look at using GL_POINT_SMOOTH. It’s what I used for my game, Pizarro, which involves a lot of circles. Here’s a detailed writeup of my experience with drawing antialiased circles on the iOS:

    http://sveinbjorn.org/drawing_antialiased_circles_opengl_iphone

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is any ways to listing all main directories present in php server(may it
There are various ways of exiting a process: e.g.: ExitProcess, ExitThread (from the main
Ok, here's the condensed form. I have three main tables to draw data from:
Problem I know there is a lot of ways of doing Model validation within
I'm trying to understand memory fences in c++11, I know there are better ways
I know there are many people who have the problem. I've tried many ways
With new Html 5 there are 3 main ways to store data in your
As far as I can tell, there are two main ways of creating functions
The scope of this is that we have three main projects. Some of the
Everywhere I look android programs are said to be built on three main components:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.