Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Vector3 GetVertexNormal(int index)
- {
- Vector3 normal = Vector3.Zero;
- for (int i = 0; i < Indices.Length; i++)
- {
- if (Indices[i] == index)
- {
- normal += DataHelper.GetNormalFromCCWTriangle(Vertices[Indices[i - (i % 3)]], Vertices[Indices[i - (i % 3) + 1]], Vertices[Indices[i - (i % 3) + 2]]);
- i += 3 - (i % 3);
- }
- }
- normal.Normalize();
- return normal;
- }
Add Comment
Please, Sign In to add comment