We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've found that normals of the terrain entity vary too little, i.e. they point mostly upwards even if the terrain is sloping.
The current code: models/procedural/terrain.py
rl = _height_values[x+1][z] - _height_values[x-1][z] fb = _height_values[x][z+1] - _height_values[x][z-1] self.normals.append(Vec3(rl, 1, fb).normalized())
It seems the two derivatives rl and fb should be scaled with the mesh size, as for example here: https://stackoverflow.com/questions/6656358/calculating-normals-in-a-triangle-mesh/21660173#21660173
I tried the following and it works much better (still not sure if there's a factor 2 missing):
rl = (_height_values[x+1][z] - _height_values[x-1][z]) * (w-1) fb = (_height_values[x][z+1] - _height_values[x][z-1]) * (h-1) self.normals.append(Vec3(rl, 1, fb).normalized())
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've found that normals of the terrain entity vary too little, i.e. they point mostly upwards even if the terrain is sloping.
The current code:
models/procedural/terrain.py
It seems the two derivatives rl and fb should be scaled with the mesh size, as for example here:
https://stackoverflow.com/questions/6656358/calculating-normals-in-a-triangle-mesh/21660173#21660173
I tried the following and it works much better (still not sure if there's a factor 2 missing):
The text was updated successfully, but these errors were encountered: