notgiven688 / jitterphysics

A cross-platform, realtime physics engine for all .NET apps.
MIT License
386 stars 87 forks source link

Incorrect normals calculations in DrawStuffOtk.cs (I've fixed it and included the fix in this Issue) #18

Closed ghost closed 3 years ago

ghost commented 7 years ago

The issue is that the normals calculations are incorrect, and cause triangle model lighting to be completely mangled. The problem lines are right here:

https://github.com/mattleibow/jitterphysics/blob/master/samples/JitterOpenGLDemo/JitterOpenGLDemo/DrawStuffOtk.cs#L928-L971

And the issue can be fixed by changing the selected lines above to:

https://pastebin.com/7uy1hufD

na2axl commented 7 years ago

@jabukufo why not a PR ?

notgiven688 commented 3 years ago

The demo code will be updated anyway soon. But thank you for the fix. If you want to fix it in the current repo please provide a PR.