You can do the same thing using vec_rotate. 3DGS doesn't allow you to organise your entities into parent-child heirachies, so you will have to manage that yourself.

An example of rotating something about a point:

Code:

action orbit
{
var angular_velocity[3];
vec_set(angular_velocity, vector(5,0,0); //5 degrees pan per tick


while(my)
{
//velocity to pivot
vec_set(temp,angular_velocity);
vec_scale(temp, time);

//length and direction of vector to rotate
vec_diff(temp2, my.x, parent_entity.x );

//rotate it
vec_rotate(temp2, temp);

//add it back to the parent entity's position
vec_add(temp2, parent_entity.x);
vec_set(my.x, temp2);

wait(1);
}

}



Untested, but should do the job.


EDIT>>> Actually ,that would just rotate the object around the level origin. You need to find the length and direction of the parent entity to the child, rotate that around the origin then put it back. I have changed the above code to do this.

Yes, a single command that does all that would be convenient.


Last edited by A.Russell; 04/09/06 03:44.