Here's a basic script that allows you to focus the view on a specific location, such as a point on the surface of a model.
code:
// Create a point picker.
var pointPicker = moi.ui.createPointPicker();
// Wait for the user to pick a point.
pointPicker.waitForEvent();
// The user picked a point.
if (pointPicker.event == 'finished') {
// Set the 3D viewport's target to the location of the picked point.
moi.ui.mainWindow.viewpanel.getViewport('3D').targetPt = pointPicker.pt;
}
|