Re: [script] normal vector to xyz rotation?

Date : Mon, 5 Sep 2005 22:43:31 +0200
To : <XSI(at)Softimage.COM>
From : "peterb" <peter_b(at)skynet.be>
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

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.