Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - You can change your system assigned username to something more personal in your community settings.
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Mar 07, 2011
11:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 07, 2011
11:14 AM

Can someone explain the 3d transform command for Cad Process?

I'm wondering how you use the 3d transform command within macros.

I want to let users set a rotation angle and then click on x, y or z icons to rotate that amount on a 3d drawing.

Problem is that macro help doesn't explain how it's used.

The syntax is just:

3D TRANSFORM 3d-matrix

and the example is:

#stretching the drawing to double size

#along the y-axis

3D TRANSFORM 1 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0

I can't find any reference to this 3d-matrix - how are we to know what each number represents?

I've recorded some macros setting the Y angle rotation to 90 degrees but this hasn't helped me understand the matrix any better as it comes up with:

3D Transform 0 0 (-1) 0 0 1 0 0 1 0 0 0 0 0 0 1

No record of 90 degrees in that matrix, so I guess one of the numbers - "1" or "(-1)" must refer to the 90 degrees.

2 REPLIES 2

Mar 15, 2011
06:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 15, 2011
06:25 AM

You can read the 16 values as the four rows of a 4x4 transformation matrix.

Here you can find a nice short description how to get such a matrix from rotation values:

http://planning.cs.uiuc.edu/node104.html

E.g.:

Macro Rotate_3d_y

Define beta as Float

beta = Get Float "Rotation angle around y "

3D Transform \

cos(beta) 0 sin(beta) 0 \

0 1 0 0 \

(-sin(beta)) 0 cos(beta) 0 \

0 0 0 1

End Macro

Mar 16, 2011
11:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 16, 2011
11:58 AM

Thanks for that.

I won't pretend to understand it, but at least it explains that the numbers all represent something and I'll work on your example - much appreciated.