Sorry if I have missed it in the API documentation but could someone point me to where the definition is for each of the 16elements in the transformation array created by Transformation.to_a (http://code.google.com/apis/sketchup/do ... ation.html)? I have discovered elements 12,13,14 => x,y,z and was hoping to get the rest without trial and error.
Thanks for your help.
Transformation.to_a array definition
9 posts
• Page 1 of 1
Re: Transformation.to_a array definitionAs far as I know the 16 things aren't [well] documented...
TIG
Re: Transformation.to_a array definitionPity  maybe Jim can help?
What I really need for now is to determine the unit vectors for the local axis of a group or component instance entity. Anyone know if this is in the transformation array or of an easier way? Re: Transformation.to_a array definitionthe 16 unit array is a 4 by 4 grid of numbers. There are resources on the internet that begin to explain hot to work with it directly. So far I've gotten around it for the most part by using methods offered in the API.
To get the unit vectors for a componentinstance (or group), use this comp_x_axis = component_instance.transformation.xaxis comp_y_axis = component_instance.transformation.yaxis comp_z_axis = component_instance.transformation.zaxis That will return a unitvector for each axis of the group or component. Hope that helps, Chris
Re: Transformation.to_a array definitionnot having looked at it much myself i cant say for sure, but its likely the numbers are the elements of a 4x4 transformation matrix.
Lots of info through google: http://www.google.co.uk/search?rlz=1C1C ... sformation although it can be a bit tricky to wrap your head around if you havent done much matrices stuff before. Re: Transformation.to_a array definitionSome years ago I wrote a plugin shader for MentalRay that uses the transformation matrix for different modifications like translation, rotation, scale, shear, rotation order, rotation axis, rotation pivot and scale pivot.
If you're interested in looking at the source code for it (C++) to see "what does what" you can find it here: http://www.pixero.com/files/JS_Place3dTexture.zip
Re: Transformation.to_a array definitionThanks guys. My math is so rusty that I did not realize that a 4x4 transformation matrix had a "standard" mathematical definition.
Re: Transformation.to_a array definitionDon't worry, nether did I. I found it on Wikipedia, but the math involved is a bit over my head for the time being. But in time I hope to get it figured out. Glad you got it working though,
Chris
9 posts
• Page 1 of 1

Who is online
Users browsing this forum: Google Bot, jettie and 3 guests