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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:36:32+00:00 2026-05-14T00:36:32+00:00

I am trying to make a few effects in a C+GL game. So far

  • 0

I am trying to make a few effects in a C+GL game. So far I draw all my sprites as a quad, and it works.

However, I am trying to make a large ring appear at times, with a texture following that ring, as it takes less memory than a quad with the ring texture inside.
The type of ring I want to make is not a round-shaped GL mesh ring (the “tube” type) but a “paper” 2D ring. That way I can modify the “width” of the ring, getting more of the effect than a simple quad+ring texture.
So far all my attempts have been…kind of ridiculous, as I don’t understand GL’s coordinates too well (and I can’t really understand the available documentation…I am just a designer with no coder help or background. A n00b, basically).

glBegin(GL_POLYGON);
for(i = 0;i < 360; i += 10){
  glTexCoord2f(0, 0);
  glVertex2f(Cos(i)*(H-10),Sin(i)*H);
  glTexCoord2f(0, HP);
  glVertex2f(Sin(i)*(H-10),Cos(i)*(H-10));
  glTexCoord2f(WP, HP);
  glVertex2f(Cos(i)*H,Sin(i)*(H-10));
  glTexCoord2f(WP, 0);
  glVertex2f(Sin(i)*H,Cos(i)*H);
} 
glEnd();

This is my last attempt, and it seems to generate a “sunburst” from the right edge of the circle instead of a ring. It’s an amusing effect but definitely not what I want. Other results included the circle looking exactly the same as the quad textured (aka drawing a sprite literally) or something that looked like a pop-art filter, by working on this train of thought.

Seems like my logic here is entirely flawed, so, what would be the easiest way to obtain such a ring? No need to reply in code, just some guidance for a non-math-skilled user…

Edit: A different way to word what I want, would be a sequence of rotated rectangles connected to each other, forming a low-resolution ring.

  • 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-14T00:36:33+00:00Added an answer on May 14, 2026 at 12:36 am

    So you want an annulus? That is, the area between two circles with the same center but different radii? I’d try a quad strip like this:

    glBegin(GL_QUAD_STRIP);
    for(i = 0; i <= 360; i += 10){
      glTexCoord2f(WP*i/360, 0);
      glVertex2f(Cos(i)*(H-10),Sin(i)*(H-10));
      glTexCoord2f(WP*i/360, HP);
      glVertex2f(Cos(i)*H,Sin(i)*H);
    } 
    glEnd();
    

    Each quad is a 10-degree sector of the ring. Note that if you want to draw N quads in a strip, it takes 2*(N+1) points, so we draw a total of 2*(36+1) = 74 points.

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

Sidebar

Related Questions

Trying to make a make generic select control that I can dynamically add elements
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to make a generic PL/SQL procedure to export data in specific XML format,
Trying to make a web service call to an HTTPS endpoint in my Silverlight
I'm trying to make the case for click-once and smart client development but my
I'm trying to make a data bound column invisible after data binding, because it
I'm trying to make a context menu for a control that is linked to
I am trying to make a div, that when you click it turns into
I am trying to make a JTable that has column spans available. Specifically, I
I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on

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.