Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 26th September 2006, 09:38 PM   #9
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Get Rotation of a Group or Object

Quote:
Originally Posted by conzar View Post
Humm. Seems like the above code rotates an object about the origin. How would I rotate it about the center of the object? I would like the same functionality as the rotate buttons on the left side bar.
You'll want to move the object to the origin, rotate it, then move it back to its original position. The rotation function exposed through the SDK doesn't handle the translation part of the equation.

Alternatively, you could call the code that AC3D uses when you use the left side bar rotate function. Check out the ac3d.tcl file in the "scripts" directory and look for "ac3d rotate_axis_angle". This snippet might help:

Code:
// Specify axis where 0 = x, 1 = y, 2 = z
int axis = 1;
float degrees = 90.0f;
tcl_command( "ac3d rotate_axis_angle %d %g", axis, degrees );
The above code should rotate the selected geometry 90 degrees around the Y axis, relative to the object/selection center. Note that this is off the cuff and untested.

Good luck
Dennis is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 05:10 PM.


AC3D Forum
(C) Inivis Limited 2020