AGI Components with Insight3D Alpha 2008 r8
Initialization

All primitive provide one or more Initialize methods. After a primitive object is created with new, one of its Initialize methods must be called. Treat Initialize methods as you would constructors. For example:

CopyC#
IAgGxCentralBody earth = sceneManager.CentralBodies("Earth");
IAgGxPrimitiveModel model = new AgGxPrimitiveModel();
model.InitializeCartographic(earth,
    "file:///./Data/Models/hellfire.dae",
    Trig.DegreesToRadians(39.88),
    Trig.DegreesToRadians(-75.25),
    5000);

A model primitive is created and initialized with a model file, a location to place the model, and a hint on how the primitive's position will change over time.

The first argument defines the central body the primitive is located on. The last three arguments define the latitude, longitude, and altitude to place the model. As with all Insight3D interfaces, latitude and longitude are defined in radians, and altitude is defined in meters.

All cartographic Initialize methods implicitly set the primitive's reference frame to the central body's fixed frame. Initialize methods that take Cartesian points allow the caller to define the frame the points are defined in. For example:

CopyC#
IAgGxCentralBody earth = sceneManager.CentralBodies("Earth");
IAgGxPrimitivePolyline line = new AgGxPrimitivePolyline();
line.InitializeFromEndPoints(earth,
    AgGxReferenceFrame.ReferenceFrameInertial,
    AgGxVertexUpdate.VertexUpdateSet,
    0, 0, 0,
    6000000, 0, 0,
    null);

A polyline is initialized with two points defined in the earth's inertial frame.

Primitives also provide a family of Set methods which have stripped down Initialize signatures. These methods are used to update the position of the primitive after it is initialized.