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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:24:06+00:00 2026-06-11T11:24:06+00:00

For a game I am working on I would like to implement a scrolling

  • 0

For a game I am working on I would like to implement a scrolling starfield. All the game so far is being drawn from OpenGL primitives and I would like to continue this and gl_points seems appropriate.

I am using pyglet (python) and know I could achieve this storing the positions of a whole bunch or points updating them and moving them manually but I was hoping there was a neater alternative.

EDIT:
In answer to Ian Mallett
I guess what I am trying to ask is if I generate a bunch of points, is there some way I can blit these onto some kind of surface or buffer and scroll this in the background.

Also as for what kind of star-field all I am trying to generate at this stage all I am trying for a simple single layer for a top down game, pretty much how you would have in asteroids

  • 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-06-11T11:24:08+00:00Added an answer on June 11, 2026 at 11:24 am

    Can you clarify what sort of starfield? 2D scrolling (for a side or top scrolling game, maybe with different layers) or 3D (like really flying through a starfield in an impossibly fast spaceship)?

    In the former, a texture (or layers of textures blended additively) is probably the cleanest and fastest approach. [EDIT: Textures are by far the best approach, but if you really don’t want to use textures, you can do the following, which is the next best thing:

    • Make a static VBO or display list of points that is maybe six times as large as it needs to be in the direction of scroll (e.g. if you’re running 800×600 screen and you’re scrolling horizontally, generate points on a 4800×600 grid).
    • Draw these points twice, offset by the width and the scrolling variable. E.g., let x be your scrolling variable (it starts at 0, then is incremented until it reaches 4800 (the width of your points), and then wraps back around and restarts at 0). Each frame, draw your points with a glTranslatef(x,0,0). Then draw them again with a glTranslatef(x+4800,0,0).
    • In this way your points will scroll past seemingly continuously. The constant (I chose six, above) doesn’t really matter to the algorithm. Larger values will have fewer repeats but slower performance.
    • You can also try doing all of the above several times with different scrolling constants to give the illusion of depth (with multiple layers).

    ]

    In the latter, there are a bunch of clever algorithms I can think of, but I’d suggest just using the raw points (point sprites if you’re feeling fancy); GPUs can handle this if you put them in a static VBO or display list. If your points are small, you can probably throw a few thousand up at a time without any noticeable performance hit.

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

Sidebar

Related Questions

I'm working on a game using OpenGL and C++. I would really like hardware
I am working on a video game launching program, and would like to include
So I am working on a game and I would like to make my
I am working on a game in Javascript, and I would like to be
I am working on a game and I would like to add a proper
Working on game where plates will be falling from top to bottom. Some plates
This is my first game I'm working on in C++ using OpenGL for graphics
This is a little snippet from a little flash game I'm working on: This
I'm practicing writing MVC applications. I have a Mastermind game, that I would like
I am working on a game that is coded in C++ and I would

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.