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

Fix an issue where camera position isn't used in grid calculation #20

Merged
merged 2 commits into from
Jan 8, 2023

Conversation

disusdev
Copy link
Contributor

The camera position was missed from the grid calculation, so the grid always stuck in the origin.

@corporateshark
Copy link
Collaborator

  1. What does it change visually?

  2. This changeset breaks Chapter 7.

after changes in gridColor function
@disusdev
Copy link
Contributor Author

disusdev commented Jan 2, 2023

Oh, I see, my fault, I forgot about an infinite plane. Here is the fix for that.
So the grid stays always in world origin, as we render the plane, but it is called an infinite grid, so I've added camera XZ position to plane and UV, to make sure that it will always draw the grid on camera XZ position.

Before:
before_fix
After:
after_fix

@corporateshark corporateshark merged commit 6b0cc08 into PacktPublishing:master Jan 8, 2023
@corporateshark
Copy link
Collaborator

Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants