Quantcast
Channel: Latest Questions by frogsbo
Viewing all articles
Browse latest Browse all 90

LookRotation flipping 180 degrees through y axis

$
0
0
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

Viewing all articles
Browse latest Browse all 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>