I have LookRotation to rotate some points as the move through space, and when it crosses the Y axis it rotates by 180 degrees, sometimes 120, so there is an error in the mesh.
this is the rotation code i am using:
function rotatem ( origVerts: Vector3 ):Vector3 {
var rotation = Quaternion.LookRotation(line(steps+0.1)-line(steps-0.1), Vector3.up);
//rotation *=Vector3(0,1,0);
var translation: Vector3=Vector3.zero;
var scale = Vector3(1, 1, 1);
var newVerts: Vector3 ;
//var rotation = Quaternion.Euler(0, Time.time%199, 0);
var m = Matrix4x4.TRS(translation, rotation, scale);
newVerts = m.MultiplyPoint(origVerts);
return newVerts;
}
![alt text][1]
[1]: /storage/temp/23541-fliprotation.jpg
↧