What we need to convert normals

Contains information and downloads about the GSF file format reverse engineering progress and the GSF Unpacker.
Post Reply
User avatar
Zidell
- Dragon Clan -
- Dragon Clan -
Posts: 268
Joined: Tue Mar 24, 2015 13:53 pm

What we need to convert normals

Post by Zidell »

There is an array of normals built into the exe:
double[,] NormalSphere = { { -10.366338015, -13.403928012, 24.838235021 }, { -0.421177, -0.524277985, 0.740095973 } }; //total 512 values
We need to compare a model normals with the array normals and find the value in the array that is closest to a model normals and get the id of this element
double[] VertexNormal = { -0.5, -0.6, 0.5 };

So the result should be index 1
Since { -0.421177, -0.524277985, 0.740095973 } is closer to the { -0.5, -0.6, 0.5 } than the { -10.366338015, -13.403928012, 24.838235021 }
Image
Post Reply

Return to “GSF Modding”