Place the following code into the OnDraw trigger of the object (this trigger is found in the objects properties window):
Code:
// Set the view points to the spatial location of the object and rotate the view
// the treenode item here is the moving object that you want to focus.
// firstly, project location of item into model space
double itemposx;
double itemposy;
double itemposz;
itemposx = vectorprojectx(item,0,0,0,model());
itemposy = vectorprojecty(item,0,0,0,model());
itemposz = vectorprojectz(item,0,0,0,model());
// Set view location
set(viewpointx(view),itemposx);
set(viewpointy(view),itemposy);
set(viewpointz(view),itemposz);
// rotate the view by increasing rz
set(viewpointrz(view),get(viewpointrz(view))+0.2);
// return 0 to execute object's default ondraw code
return 0;