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 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

I'm trying to make a game with bunch of sound effects added. A lot
i'm trying to make my site with a few languages. Every page includes config-file,
I'm trying to make a ticketing system, but there are a few ways of
I'm using TCPDF in CakePHP and trying to make some background (grey) for few
I'm trying to make a batch file to publish the few ClickOnce application we
I'm trying to make a little Hello World webservice with Django following a few
It's my first time trying to make a contactform. And I've got a few
I've created a few buttons in Flash. I'm trying to make it so that
I'm considering trying to make a game that takes place on an essentially infinite
I've been trying to make use of DetailsView for the past few days to

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.