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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:28:48+00:00 2026-05-13T06:28:48+00:00

What is the best mechanism for handling large scale structures and scenes? Examples being

  • 0

What is the best mechanism for handling large scale structures and scenes?

Examples being a continent with scale cities and geography, or infinity universe style planetary transitions.

  • 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-13T06:28:49+00:00Added an answer on May 13, 2026 at 6:28 am

    The biggest problem with working with floating point representations of positions in large scale is that you rapidly lose precision as you get further and further away from the origin.

    To remedy this you need to express all positions as relative to something else than the origin. The easiest way to do this is to partition the world into a grid and store the positions of all entities something like this:

    struct Position {
        int kilometers[3]; // x, y and z offset in kilometers
        float offset[3]; //x, y and z offset in meters
    };
    

    The position of the camera is also stored like this, and when it’s time to render you do something like this:

    void
    getRelativePosition(float& x, float& y, float& z, const Position& origin, const Position& object) {
        x = (object.kilometers[0] - origin.kilometers[0]) * 1000.0f +
            (object.offset[0] - origin.offset[0]);
        //Ditto for y and z
    }
    
    //Somewhere later
    float x, y, z;
    getRelativePosition(x, y, z, camera.position(), object.position());
    renderMesh(x, y, z, object.mesh());
    

    (For simplicity I ignored the orientation of camera and objects in this example, since there are no special problems associated with this).

    If you’re working with a continuous world on a galactic scale you can replace the kilometers parameter with a long long (64 bits) giving you an effective range of 1.8 million lightyears.

    EDIT: To use this for continuous geometry such as terrain etc, you have to split the terrain into chunks of size one square kilometers, the coordinates of the vertices in the terrain chunk should be in the range [0, 1000].

    Also in the function getRelativePosition above you could change it so it returns a bool and return false if the difference in kilometers is larger than some threshold (say the distance to your far clip plane).

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

Sidebar

Related Questions

At the risk of being downmodded, I want to ask what the best mechanism
In short: what is the best way to design and implement a factory+plugin mechanism,
Best recommendations for accessing and manipulation of sqlite databases from JavaScript.
How best to make the selected date of an ASP.NET Calendar control available to
For best performance, is it better to use a virtual IDE HDD or virtual
As best-behaved as I try to be about keeping my unit tests disconnected from
How best can I convert instances of double backslashes to a single backslash in
What best practices should be observed when implementing HDL code? What are the commonalities
The best I can come up with for now is this monstrosity: >>> datetime.utcnow()
The best that I have been able to come up with is: strlen(preg_replace('/^([\\*]*)\s(.+)/',$1,$line)); ^^That

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.