Squeezing more info out of a matrix connector?

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Squeezing more info out of a matrix connector? // Scriptorium

1  |  

Post by ProfessorKhaos // Apr 3, 2007, 5:36pm

ProfessorKhaos
Total Posts: 622
pic
Hi all,


Been studying this whole translation matrix thing.


It appears there's a little additional information that could be extracted from a matrix connector, that as of yet doesn't appear to be addressed. I'm thinking this would be a good scripting project.


Example (works in prior versions of truespace too)


Create a cube.


Rotate it about 45 degrees or so around one of the axis


Scale the object (using world coordinates) in one of the other axis


Now in the object panel, enter a rotation of 0,0,0 and a scale of 1,1,1


You'll see your object is skewed due to the scaling along world rather than object coordinates.


Hit normalize scale icon. Skew disappears ('cause transformation matrix is reset to identity matrix actually not... position and roll pitch yaw are still present)


There's more info in there than just x,y,z, roll,pitch,yaw, and scale_x,scale_y,scale_z. There's also at least a slew_x,slew_y,slew_z term I think might be extractable. They don't get treatment quite the same way as the others but they can manifest themselves in your meshes.


I'm thinking it might be of some use to come up with some scripts to replace those expanded input and output connecters with ones also containing the slew amounts. Just another level of control I suppose. Maybe useful in a custom tool also...

Post by ProfessorKhaos // Apr 3, 2007, 7:53pm

ProfessorKhaos
Total Posts: 622
pic
Hmmm... upon further review, there are some ambiguities introduces by accounting for skews. Will have to look at this one further to see if there's a simple means to sort it all out.


Skew in one axis might be equivalent to a skew along a 2nd axis with rotation and scale thrown in.


Will try out a few scenarios to see what I can come up with. Back to the math books...

Post by trueBlue // Apr 3, 2007, 9:09pm

trueBlue
Total Posts: 1761
pic
Hey Glen: Are you referring to the Shear X,Y,Z?
If so look in the DX - Transform library you will find the Euler node.
There you will see shx, shy, and shz.
Also if you Expand your Object's Matrix and then change it's Aspect to EXP you will see Shear there too.

Post by ProfessorKhaos // Apr 4, 2007, 4:05am

ProfessorKhaos
Total Posts: 622
pic
Yep. I meant shear. Guess this is the quickest script writing project I'll ever start! Mission accomplished!!!! :o


Thanks trueBlue!!!! To restate my scripting efforts as a metaphor, I'm busy climbing ladders and you're making sure they're leaning against the right wall. :)


Glen

Post by Norm // Apr 4, 2007, 6:25am

Norm
Total Posts: 862
pic
I created script long ago: Script Objects/Matrix Info. It called the four main areas of matrix: location, rotation, scale and shear.

There is more there for sure :) More than just the four :)

Post by trueBlue // Apr 4, 2007, 8:53pm

trueBlue
Total Posts: 1761
pic
Glen: I was not sure where you were going with this but I am still intrigued. Even more so after Norm's little hint. I have a favor to ask of you.
Can you help with this project?
http://forums1.caligari.com/truespace/showthread.php?t=1471

Maybe you could shed some light on selecting an item from a Combo control and doing something with that selection.

Post by ProfessorKhaos // Apr 5, 2007, 2:52am

ProfessorKhaos
Total Posts: 622
pic
I will take a look sir! :)
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn