MackeyK24 Posted December 5, 2016 Share Posted December 5, 2016 Can someone please help me out with computing normals from just the verts and triangles in C# Unity Side. Currently i am using the Unity Mesh object to calculate normals like so: Mesh mesh = new Mesh(); mesh.name = "sceneNavigationMesh"; mesh.vertices = triangulatedNavMesh.vertices; mesh.triangles = triangulatedNavMesh.indices; mesh.RecalculateNormals(); But the Mesh object is limited to 65000 verts... So i am going to need to manually calculate normals... But don't know how. What are the Magic Formulas for calculating the normals? Again... Any help would be awesome Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 5, 2016 Share Posted December 5, 2016 Here we are: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.vertexData.ts#L1965 Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted December 6, 2016 Author Share Posted December 6, 2016 I tried the ComputeNormal code (both in babylon javascript and from C# exporter)... The verts are listed in debug layer but does not show up... It looks like it reversed or something... Because the vertex data is coming string from unity raw heights maybe we have to flip the normals or something like like... Can (AND HOW) would i flip normals (if thats even the problem) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 6, 2016 Share Posted December 6, 2016 Flipping a vector means multiplying it by -1 (on each component I mean) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.