[Closed] moving forwards
Hello, i’m an extreme noob at maxscript and have been playing with bobo’s latest matrix disk (which is great ).
I was looking for a way of defining when a node was moving forwards or sideways in its local coordsys, not just in the world coord. The use for this for example is to define whether a wheel was travelling forwards or backwards which ever way it faced in the world etc.
I have it working using this code which is applied as a script to a box in the height channel, it affects an object called Arrow in the scene and changes the wire color based upon its movement. :-
at time (F+1) Fpos = MyArrow.pos
theVector1 = normalize MyArrow.transform.row1
theVector2 = normalize (Fpos – MyArrow.pos)
theAngle = acos (dot theVector1 theVector2)
MyArrow.wirecolor = if theAngle < 90 then green else red
0
I can’t help feeling this is a crude and inacurrate way of doing this and would appreciate some input as to how others would achieve a similiar result, for all axis.