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

Reply
 
Thread Tools Display Modes
Old 26th September 2006, 09:14 AM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Get Rotation of a Group or Object

Hot dang your right. Just saw your post today ... so I'll try that tonight.

Thanks
conzar is offline   Reply With Quote
Old 26th September 2006, 08:54 PM   #2
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Get Rotation of a Group or Object

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.

Thanks.
conzar is offline   Reply With Quote
Old 26th September 2006, 09:38 PM   #3
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
Old 27th September 2006, 01:56 PM   #4
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Get Rotation of a Group or Object

Yep. That did the trick.

Thanks!!!!
conzar is offline   Reply With Quote
Old 25th October 2006, 04:52 PM   #5
jmaida
Junior Member
Member
 
jmaida's Avatar
 
Join Date: Sep 2005
Posts: 10
Question Re: Get Rotation of a Group or Object

I have examining the file format for rotation values. The description of the format says that there a field called "rot" followed by values of the rotation matrix. After rotating objects and groups of objects all over the place and saving the file at various steps of the process, I failed to find "rot" anywhere in the saved file. It appears that a rotation is applied to the vertices then simply forgotten. However, that does not seem to be the case for translations. This seems to me to be an odd inconsistancy and an omission of some useful information that is needed to restore the initial condition of object.
jmaida is offline   Reply With Quote
Reply


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:33 AM.


AC3D Forum
(C) Inivis Limited 2020