On 02/17/2012 01:11 AM, Randall Morgan wrote: > Try a little conditional: > > if abs(a1 - a2)> 180 then rotate counter clockwise > else rotate clockwise > > I think this will work try it and see...
Thou art a genius. :) I used your suggestion along with this site: http://www.kirupa.com/forum/showthread.php?63633-shortest-distance-between-two-angles and came up with: ' Check if camera orientation is locked to client player orientation. If Camera.Locked Then ' Move camera orientation closer to player orientation (interpolate). Distance = Convert.Wrap_Single(0, 359, Abs(Camera.Orientation - Client.Player[Client.Number].Orientation)) If Distance > 180 Then Distance = 360 - Distance If Abs(Convert.Wrap_Single(0, 359, Camera.Orientation - Client.Player[Client.Number].Orientation)) > 180 Then Camera.Orientation = Convert.Wrap_Single(0, 359, Camera.Orientation + 0.1 * Distance) Else Camera.Orientation = Convert.Wrap_Single(0, 359, Camera.Orientation - 0.1 * Distance) Endif Endif It works brilliantly. Muchas gracias and domo arigato. -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: [email protected] phone: (770) 853-6271 ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
