createModel Method

Creates a new model from an external file on the terrain.

createModel(position, modelURL, [scale], [name]);

 

Parameter

Description

position

The position of the object, defined by its coordinates in the  3D world

Can be one of the following: SGCoord3D, SGCoord2D, SGPosition

modelURL

The model URL

scale

Optional

The model’s dimensions in meters per pixel

name

Optional

The node name

Return Value

An SGNode object. If the method fails, the return value is null. SGWorld.lastError will contain the failure reason.

Remarks

To modify other properties of the model, access the node innerObj. See SGNode.innerObj property and ITerrainModel5 interface for more details.