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 4583806
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:15:58+00:00 2026-05-21T21:15:58+00:00

I am trying to get some circles drawn onscreen using OpenGL ES 1.5 for

  • 0

I am trying to get some circles drawn onscreen using OpenGL ES 1.5 for android. They draw, but I want to be able to input x=300, y=500, and it will draw the circle centered at that coordinate (e.g. at the (300,500) pixel on the screen). Currently, I draw and translate the circles, but its not precise, I don’t know how to get it exactly where i want it: here’s some broken code from my last attempt:

//doesn't take w/h ratio into consideration, not sure how to implement that
gl.glViewport(0, 0, windowWidth, windowHeight);
gl.glOrthof(0,windowWidth,   0, windowHeight,    1, 2);
GLU.gluLookAt(gl,   0, 0, 5,    0, 0, 0,    0, 1, 0);

//And for drawing a circle, with the desired x and y coordinates:
for (int j = 0; j &lt number_Triangles; j++) {
  x = Math.cos(theta) + xCoor;
  y = Math.sin(theta) + yCoor;
  z = 1;
 theta += 2 * Math.PI / (number_Triangles);
}
  • 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-21T21:15:58+00:00Added an answer on May 21, 2026 at 9:15 pm

    If you are doing 2D graphics, I’d recommend gluOrtho2D(left,right,bottom,top). That way you have exact control over what coordinates will map to each edge of your screen.

    So, for example, you could have:

    gl.glViewport(0,0,windowWidth,windowHeight);
    GLU.gluOrtho2D(-2.0f, 2.0f, -2.0f, 2.0f);

    for (int j = …..

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

Sidebar

Related Questions

Im trying to get some system information using WMI but the problem is when
Just trying to get some rows out of a database and loop through but
i am trying to get some data, but i dont know how can i
I'm trying to get some json data in my application, but it won't come
I am trying to get area of circle using my program. But area is
I'm trying get some licensing code from AndroidPit.com working, but I get Unable to
Trying to get some movies and their genres but leave out any records that
Trying to get some good advice on the best approach to using arrays for
I'm trying to do some basic opengl es programming to get started on the
I am trying to get some xpath from xsl variable using xsl ver 1.0

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.