|
it's a good solution but beware of the speed overhead that
comes with calling commands.
From: owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM] On Behalf Of peterb Sent: 05
September 2005 21:44 To: XSI(at)Softimage.COM Subject: Re:
[script] normal vector to xyz rotation?
hey Brad, that is great!
gonna do it right away.
In
this case, it might be worth writing a simple wrapper function to have
jscript deliver its Math object for you to use in vbscript. I just tested
this technique and it worked fine and took only about a minute to set
up.
In jscript, write the following function:
function
GetMathObj(){ return(Math); }
1-
Install this into XSI as a command (you can drag and drop the code). 2-
Set both the button and script names to something like "GetMathObj" 3-
Press the Parse Script button on the lower right so the command runs your
function
Once this command is part of XSI, you can switch back to
vbscript and access all of the goodies jscript's Math object has to offer,
including the acos method:
set m =
GetMathObj LogMessage(m.acos(0.5))
Here's the weblink
for info on jscript's Math object: http://msdn.microsoft.com/library/default.asp?url="">
-Brad
|