View Single Post
Old 11th September 2007, 11:08 PM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Question How to move an object to the origin and back

Hello. I would like to know how to move an object to the origin and then back to its original location. I've tried the code that is below; however, when the function exits, the object is left at the origin.

Code:
   ACObject *obj = ... get from somewhere

   // get the center of the object
   Point3 *centre = ac_object_get_centre(obj);
    // move it to the origin
    translate_object_zero(obj);
    // do something useful here 
 
    // move it back
    translate_object(obj,centre);
I've also tried translate_object_abs and get the same results.

Anyone know what I'm doing wrong?

Using AC3D 6.2.05 linux version.
conzar is offline   Reply With Quote