Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move region data from centered (-512,-512) to zero aligned (0, 0) #195

Closed
TokisanGames opened this issue Aug 28, 2023 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 28, 2023

The terrain currently centers region (0, 0) at the world origin. While this might make sense when there is one region, it doesn't make any sense when you have a much larger world as the whole world is shifted by half a region.

image

This is a bit awkward. Two 8ks imported at -8192, -8192 and 0, 0. Yet the origin is positioned in the center of 0,0, when it should be on the edge since we're doing 16x16 regions.

The world boundaries are not -8 to +8 regions but rather -8.5 to +7.5.

Also see #183 for a problem this created.

In the commit that closes this, we will move the terrain (512, 0, 512) so it is aligned on the world origin. Users will also need to move their objects in game, which is easy to do.

How To Adjust Your Scene

Here's how to easily adjust your scene for this change:

  1. Select all of your Node3D derived objects. Don't select Terrain3D. There are multiple ways to do this:
    • Multi-select them in the scene tree by clicking and SHIFT+clicking, or CTRL+clicking individual nodes.
    • In the Scene tree Filter box at the top, type type:Node3D then select all of the nodes.
    • In the viewport, pull the camera back, then draw a large box around all nodes. You may need to set View/Settings/View Z-Far to 16384 or higher.
  2. In the viewport menu, select Transform/Transform Dialog.... Change the first row to: 512 0 512 and click OK.
  3. If you're using a custom shader, you may need to modify it. See the changes made to main.glsl.

After this your objects should line up with the terrain again.

Alternatively you can parent all of your movable objects under a Node3D, then move that one node, then unparent those nodes. Or leave it as is. Then do step 3.

image

@TokisanGames TokisanGames added the enhancement New feature or request label Aug 28, 2023
@TokisanGames TokisanGames added this to the Beta milestone Aug 28, 2023
@TokisanGames TokisanGames changed the title Move position of data from centered (-512,-512) to Zero Aligned (0, 0) Move region data from centered (-512,-512) to zero aligned (0, 0) Aug 28, 2023
@TokisanGames TokisanGames self-assigned this Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant