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

  • Home
  • SEARCH
  • 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 712335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:50:12+00:00 2026-05-14T04:50:12+00:00

I attempted to render a circle in opengl es 1.1 as a test before

  • 0

I attempted to render a circle in opengl es 1.1 as a test before building a larger program, but it renders as an oval. Here is the code I use to generate and render my vertices:

static const int numVerts = 40;

static GLfloat myFirstCircle[82];

myFirstCircle[0] = 0.0f;
myFirstCircle[1] = 0.0f;

for (int i = 2; i < (numVerts+1)*2; i+=2) {
    myFirstCircle[i] = .5 * cosf(i*2*3.14159/numVerts);
    myFirstCircle[i+1] = .5 * sinf(i*2*3.14159/numVerts);
}

glVertexPointer(2, GL_FLOAT, 0, myFirstCircle);
glEnableClientState(GL_VERTEX_ARRAY);

glDrawArrays(GL_TRIANGLE_FAN, 0, 22);

I’m still somewhat new to this system, so I may have a silly error that I do not see, but it seems to me like this should generate 40 vertices on a circle of radius .5. When it renders, the shape on screen appears to be an oval, significantly taller than it is wide.

My question is thus: why is my circle rendering this way, and what could I do to fix it? This is the first question on stackoverflow, so I’m not sure how to share an image of my output.

  • 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-14T04:50:12+00:00Added an answer on May 14, 2026 at 4:50 am

    You have to set up your projection matrix according to your screen’s proportions. As it is now, all the edges of your screen are at +-1.0, causing stretching in the long dimension. This little ditty sets the top and bottom edges to +-1.5.

    glMatrixMode(GL_PROJECTION);
    glOrthof(-1.0, 1.0, -1.5, 1.5, 1, 100);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I attempted to re-size two buttons in MSIE, so they would be extra-large but
Has anyone attempted to use SQL Server Database as a Subversion file system back
I have tried to use this code in VS2008 (and may have included too
The title attempts to summarize the problem, but here's a more detailed summary: our
The following code used to function without attempting to render a new template with
One attempted approach was to use TexturePaint and g.fillRect() to paint the image. This
My program has been working perfectly so far, but it turns out that I've
I am almost too embarrassed to ask this question, but here we go... I
Hi all I have attempted to write a simple xml reader but have found
I have a radio button control adaptor that attempts to render the radio button

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.