Mon, Jan 6, 10:56 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: WorldQuaternion - broken?


face_off ( ) posted Mon, 11 July 2005 at 10:01 PM · edited Wed, 30 October 2024 at 1:00 PM

OK, I've been working on a major Poser application, and been stuck on a roation problem from about a week now. To cut a long story short, I'm trying to get a rotation matrix from a quaterion from Actor.WorldQuaternion. Now I've tried a number of methods for converting the quaternion to a rotation matrix - including http://www.flipcode.com/documents/matrfaq.html#Q54. The rotation for the X and Z axes is comes out ok, but not the Y Axis. So I did some tests.... A prop with 10 degrees X Rotation gives a Quat of (1.575, 0.1378, 0.0, 0) - where the tuple is ordered W, X, Y, Z. 10 degrees Z rotation gives (1.575, 0.0, 0.0, 0.1378) - notice the same magnitude, and X now at Z. But 10 degrees of Y rotation gives (1.571, 0.0, 0.2210, 0.0) Notice the magnitude has changed, and the Y variable is not the same as X/Y in the previous examples. Converting the 10 degrees Y rot quat into a rotation matrix and then working out the euler angles introduces a 2-3 degree error in the Y rotation. But it only happens on the Y rotation - X and Z are ok. Anyone got any thoughts on this?

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook


PoseWorks ( ) posted Tue, 12 July 2005 at 12:53 PM

Is it related to the change in W?


stewer ( ) posted Tue, 12 July 2005 at 2:29 PM

file_269788.jpg

WorldQuaternion() seems to have problems with objects that are not scaled at 100%. I ran into the same problem once and wrote my custom routine to extract a quaternion from WorldMatrix().


face_off ( ) posted Tue, 12 July 2005 at 5:31 PM

Stewer - thanks for your code sample. And YES - I noticed it's only a problem when the object is scaled! I ended up simply extracting the rotation matrix from the world matrix. Although I noticed you've got a different way removing the scale from the WorldMatrix - which I need to lok at. Anyway, thanks again.

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook


an0malaus ( ) posted Sat, 16 July 2005 at 9:35 PM

[bookmark]



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.