Re: calculating "straight line" velocity
| Date : Fri, 30 Mar 2007 11:22:01 -0400 |
| To : XSI(at)Softimage.COM |
| From : "Byron Nash" <byronnash(at)gmail.com> |
| Subject : Re: calculating "straight line" velocity |
Thank you chaps, most helpfull.....A______________________________________________________________________-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Kim Aldis
Sent: Tuesday, December 05, 2006 10:36 AM
To: XSI(at)Softimage.COM
Subject: RE: calculating "straight line" velocityVelocity will be a vector, it needs a direction as well as a magnitude (length). What you're looking to find is the length of that vector which you can get using Pythagoras. Or you can use this dandy script. Beware, though, magnitude alone isn't enough to define either velocity or acceleration. They both need to be a vector:-
var oObj = selection(0);
var vX = oObj.kinematics.global.linvelx.value;
var vY = oObj.kinematics.global.linvely.value;
var vZ = oObj.kinematics.global.linvelz.value;
var vVec = XSIMath.CreateVector3( vX, vY, vZ );
var aX = oObj.kinematics.global.linaccx.value;
var aY = oObj.kinematics.global.linaccy.value;
var aZ = oObj.kinematics.global.linaccz.value;
var aVec = XSIMath.CreateVector3( aX, aY, aZ );
Logmessage( "Velocity Magnitude: " + vVec.length() );
Logmessage( "Acceleration Magnitude: " + aVec.length() );
From: owner-xsi(at)Softimage.COM [mailto: owner-xsi(at)Softimage.COM] On Behalf Of Andi Farhall
Sent: 05 December 2006 10:17
To: xsi(at)Softimage.COM
Subject: calculating "straight line" velocity
Hello peeps,
I'm currently doing some camera moves that will eventually end up motion control and am trying to calculate the velocity and accleration of the camera. With the global kinematic velocity and acceleration i get x y and z as seperate componetnts but i've no idea what to do mathwise to combine these numbers to get velocity in a "straight line" as in "camera doing 8 metres/second". I initially thought that i would just invert any negative numbers, add the three together and divide by 3 ( i can hear some of you laughing) but it didn't take very long before i realised it was beyond my mathmatical capabilities. Is it an easy equation that someone could explain or am i limited to doing it graphically (which will only give me velocity)?
I spent too long behind the bike shed at school clearly....
tia
Andi
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
--
Byron Nash
www.armoredsquirrel.com
- Follow-Ups:
- RE: calculating "straight line" velocity
- From: "Kim Aldis" <XSI(at)kim-aldis.co.uk>
- RE: calculating "straight line" velocity
- From: "Kim Aldis" <XSI(at)kim-aldis.co.uk>
- RE: calculating "straight line" velocity
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: Re[5]: speed comparsion, constrain, expression or linked key?
- Next by Date: RE: Re[5]: speed comparsion, constrain, expression or linked key?
- Previous by Thread: RE: Re[5]: speed comparsion, constrain, expression or linked key?
- Next by Thread: RE: Re[5]: speed comparsion, constrain, expression or linked key?
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |