I've followed some literature about matrix translation and transformation
and got the following elements:
0.707107 -0.707107 0.0 0.0
0.707107 0.707107 0.0 -7.07107
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
Please suggest me how comes the elements are different and correct my
mistake.
Thanks.
Richard Khaw
Torrance, California.
Perhaps if you explain a bit about what you're trying to do we can help more.
Regards
Wayne Ivory
IT Analyst Programmer
Wespine Industries Pty Ltd
Also, TranslateCoordinates doesn't do much for transforming
objects.
--
AcadXTabs: MDI Document Tabs for AutoCAD
http://www.acadxtabs.com
AcadX for AutoCAD 2004 Beta 1
http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip
"wivory" <nos...@address.withheld> wrote in message news:7595385.107758555...@jiveforum1.autodesk.com...
The reference to TranslateCoordinates was indicating another possible approach to the bigger picture which may or may not be relevant, hence the request for more information. For example I've created a bunch of objects "relative" to a target object by creating a UCS for it and then "transforming" all the new objects using TranslateCoordinates. Maybe that's unusual - I don't know - I was starting from the ground up at that stage and it produced the desired result.
Regards
Wayne
In standard matrix operations the 3x3 matrix in the upper left corner is the
rotation _around_ _(0,0,0)_, the 1x3 vector at the upper right corner is the
translation after the rotation, and the last row is a dummy to make it come
out right. You do a standard matrix multiplication by a 4x1 coordinate
vector (that is, {X Y Z 1} with the 1 added to make it come out right).
So, your first example rotates 45 degrees around the Z axis and translates
by 5 in the X direction and translates -2.071068 in the Y direction.
You can look at your problem as three different successive problems. I'm
going to round to fewer digits to keep the display cleaner.
1. Translate (5,5,0) to (0,0,0):
1.0 0.0 0.0 -5.0
0.0 1.0 0.0 -5.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
2. Rotate 45 degrees around the Z axis:
0.707 -0.707 0.0 0.0
0.707 0.707 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
3. Translate (0,0,0) back to (5,5,0):
1.0 0.0 0.0 5.0
0.0 1.0 0.0 5.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
Multiplying the first matrix by the second, and then the result by the
third, gives the matrix that rotates 45 degrees around (5,5,0):
0.707 -0.707 0.0 -5.0
0.707 0.707 0.0 2.071
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
Which is your first matrix except for the signs in the last column. I don't
know why my signs are different from theirs. Maybe that's a non-standard
thing in AutoCAD.
--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services