hi,
i want to calculate the direction vector for two vertices in space correctly while holding the editing ability for the transform holding the vertices , i want to use that direction vector to calculate my procedural mesh normals
this works great when the transform position and rotation are set to zero, but as soon as i change something the normals calculated are messed up
the code that i’m using to calculate the direction vector which is the normal vector too
void Normals( int index, Vector3 splineVertex )
{
var meshVertex = _Data.Vertices[index];
var normal = transform.InverseTransformDirection(meshVertex- splineVertex).normalized;
_Data.Normals[index] = normal;
}
transform is non changed
transform is changed