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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃How does this work #2

Open
hex13 opened this issue Aug 1, 2021 · 1 comment
Open

馃How does this work #2

hex13 opened this issue Aug 1, 2021 · 1 comment

Comments

@hex13
Copy link
Owner

hex13 commented Aug 1, 2021

createTerrain function does these things:

  1. creates tiles variable which is 2 dimensional array with elements like this: {faces, vertices}
  2. creates vertices
  3. creates faces and assigns appropriate vertices to them
  4. creates uvs
  5. do some updating magic on Geometry object
  6. creates few helpers functions
  7. returns object with some methods (public API)
@hex13
Copy link
Owner Author

hex13 commented Aug 1, 2021

computeIndexes function takes x and y arguments (tile coordinates) and returns object with 5 vertex indices that form this tile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant