**THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED**

*On 20/10/2012 at 00:47, ***xxxxxxxx** wrote:

As far as I kow, the only way to do this is to move all the vertices so they are equidistant from the axis.

For example, consider an object with just two vertices, one is located at Y = 100, the other at Y = -20. These are local coords, of course, relative to the axis. To center the axis you would need to move the first point to Y = 60 and the other to Y = -60. You see that the points are the same distance apart (120 units) but now the axis is central to both. Then repeat for the X and Z axes.

The algorithm would look something like this (sorry, C++ but easily portable to Python) :

```
BaseObject *obj;
Real maxy, miny, diffy;
LONG i;
Vector *padr;
padr = ToPoint(obj)->GetPointW();
if(padr)
{
maxy = miny = 0.0;
for(i = 0; i < ToPoint(obj)->GetPointCount(); i++)
{
// get the maximum and minimum Y values
if(padr[i].y > maxy
maxy = padr[i].y;
if(padr[i].y < miny)
miny = padr[i].y;
}
// calculate the difference
diffy = (maxy - miny)/2.0 + miny;
// move the vertices
for(i = 0; i < ToPoint(obj)->GetPointCount(); i++)
padr[i].y -= diffy;
}
```

This is for the Y axis only, you'd need to amend it to include all three axes. Of course, doing this will appear to move your object in 3D space, so if that isn't desirable you would need to record the object's world position before you move the vertices, then alter it after moving the vertices to put it back in the same place. The algorithm for that is left to you

Steve