Tangent Angle 2004-02-18 - By Sean Donnelly
Back If you bear with me I'll try and describe it. As Kim says its some trig function (arctangent) which returns the value in radians. So you must convert it to degrees (multiply radians by 180 / pi).
So it would be something like this. Be careful with the left & right most keys as they have zero tangents on one side (so you'll get a divide by zero).
frameRate = GetValue("Playcontrol.rate") LogMessage "Frame rate = " & frameRate & vbcr
set collection = GetSource("null.kine.local.posx",siFCurveSource) for each fcurve in collection GetFCurveInfo fcurve, crvtype, nokeyval, nbKeys, extrap, segtype, lowclamp, highclamp
for i = 1 to nbKeys - 2 GetKeyInfo fcurve, i, parameter, leftval, rightval, lefttanparam, lefttanval, righttanparam, righttanval, rightsegkind, constraints LogMessage "Key " & i & " Tan Angle = " & Atn( lefttanval / ( lefttanparam * frameRate ) ) * 180 / 3.141592 & vbcr next next
If you are using "Express slopes as ratio as in SI|3D" then its just the tangent value / tangent param:
LogMessage "Left Tan Angle = " & ( lefttanval / lefttanparam ) & vbcr
Sean
-- --Original Message-- -- From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf Of kim aldis Posted At: Tuesday, February 17, 2004 4:45 PM Posted To: xsi Conversation: Tangent Angle Subject: RE: Tangent Angle
I would imagine they're tangents, though, so probably some trig function of RightTanY and Right would do it for you. Same for left, obviously.
> -- --Original Message-- -- > From: owner-xsi@(protected) > [mailto:owner-xsi@(protected)] On Behalf Of Jabbar Raisani > Sent: 17 February 2004 21:23 > To: XSI@(protected) > Subject: Re: Tangent Angle > > Here's what I found with a little searching in the SDK doc. > Hopefully this can get you started on the right path. > > // determine if key has zero slope > var bZeroSlope = > ( (oKey.LeftTanY==0) && (oKey.RightTanY==0) ); > > If you need more I think the SDK docs could be useful . > > >Jabbar > > -- -- Original Message -- -- > From: "Sascha" <sa@(protected)> > To: "XSI-List" <xsi@(protected)> > Sent: Tuesday, February 17, 2004 5:32 AM > Subject: Tangent Angle > > > > How can I calculate the angle of the tangent of a fcurve > key in XSI? An > > example would be nice. > > > > Sascha > > > > --- > > Unsubscribe? Mail Majordomo@(protected) with the > following text in body: > > unsubscribe xsi > > --- > Unsubscribe? Mail Majordomo@(protected) with the following > text in body: > unsubscribe xsi > > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|