Re: [Scripting] XSIMath Question

Date : Thu, 1 Jun 2006 13:27:01 +1000
To : XSI(at)Softimage.COM
From : "Aloys Baillet" <aloys.baillet(at)gmail.com>
Subject : Re: [Scripting] XSIMath Question
Hi Brad,

Let's give some pretty names to you objects:-)
A, B and C are the SITransformation of the objects 1, 2 and 3, T is you final SITransformation object.
My proposal is:

var vA = XSIMath.CreateVector3 ();
A.GetTranslation(vA);
var vB = XSIMath.CreateVector3();
B.GetTranslation(vB;
var vC = XSIMath.CreateVector3();
C.GetTranslation(vC);

var vX = XSIMath.CreateVector3();
vX.Sub(vB, vA);
vX.NormalizeInPlace();
var vY = XSIMath.CreateVector3();
vY.Sub(vC, vA);
vY.NormalizeInPlace();
var vZ = XSIMath.CreateVector3();
vZ.Cross(vX, vY);

var oRot = XSIMath.CreateRotation();
oRot.SetFromXYZAxes(vX, vY, vZ);

T.SetTranslation(vA);
T.SetRotation(oRot);


It's NOT tested!!!

Cheers,

Aloys

On 6/1/06, brad < brad(at)cg-soup.com> wrote:
Let's say I have 3 global position coordinates and I need to convert them into a single Global SITransform Object.
The first point will be the location of the transform, the second point will be the direction my x-axis points at, and the third point will be the direction my y-axis points at.

What is the quickest and easiest way to calculate this using existing XSIMath Objects?

-Brad
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.