Here is a code snippet from the help files, should do what you need.
// set window properties
SetWindowTitle( "Test set pivot" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
// these are to show where world 0,0,0 is
ObjectVertical = CreateObjectBox(.1,100,.1)
SetObjectColor(ObjectVertical,255,0,0,255)
ObjectHorizontal = CreateObjectBox(100,.1,.1)
SetObjectColor(ObjectHorizontal,255,0,0,255)
// this object keeps its pivot point at
// its local 0,0,0 (center of the object)
// much like your head pivots around its center
ObjectOne = CreateObjectBox(3,3,3)
SetObjectPosition(ObjectOne,0,3,0)
// this object will have its local center at
// the worlds 0,0,0 point (the sphere)
// much like your arm pivots on your shoulder
ObjectTwo = CreateObjectBox(6,1,1)
SetObjectPosition(ObjectTwo,-3,0,0)
FixObjectPivot(ObjectTwo)
do
// rotate each object around its local center
RotateOBjectLocalY(ObjectOne,.5)
RotateObjectLocalY(ObjectTwo,.5)
Sync()
loop
The coffee is lovely dark and deep,and I have code to write before I sleep.