COLLADA Models

STK natively reads COLLADA (.dae) files. COLLADA is a popular open standards-based format that can be exported from many 3D editing applications (e.g., 3D Studio Max, Maya, Softimage, Blender, and Google SketchUp) and model converters, such as:

Ancillary Features

STK-specific features such as articulated components, attach points, and pointable elements can be added to COLLADA models. These features only pertain to STK and are called ancillary features. For the equivalent features in the MDL format, see Model Parameters.

Ancillary features use extended XML keywords that are associated with the COLLADA model using two methods.

  • Adding ancillary keywords inside the COLLADA file. This option is more compact but keywords can get lost when resaving the model from a 3D editing tool.
  • Storing ancillary keywords in a separate ancillary file (*.anc). STK associates the ancillary file with the COLLADA file when both reside in the same directory and share the same base name (e.g., ikonos.dae and ikonos.anc). This option minimizes the risk that ancillary keywords get lost when resaving a COLLADA file.

The ancillary file is an XML document with the following header and footer:

<?xml version="1.0" standalone="yes" ?>
<ancillary_model_data version="1.0">

…. ancillary data belongs here….

</ancillary_model_data>

Syntax for Ancillary Features

Syntax for adding the ancillary data to the COLLADA model is shown below for both methods. Either way produces equivalent results, so only one method should be used.

Articulations

Articulations are components (e.g., rocket stages, landing gear, doors, and propellers) that move in various ways. The motion is controlled via an articulation script.

Ancillary Syntax in COLLADA (*.dae)

<extra type="articulation_data">
   <technique profile="AGI">
      <library_articulations>
         <articulation id="HGA_Az" type="transform">
            <stage type="xRotate" name="Roll" min="-182.5" init="0" max="72.5"/>
         </articulation>
         <articulation id="HGA_El" type="transform">
            <stage type="yRotate" name="Pitch" min="-67.5" init="0" max="187.5"/>
         </articulation>
         <articulation id="Ikonos_1" type="transform">
            <stage type="uniformScale" name="Size" min="0" init="1" max="1"/>
            <stage type="xRotate" name="Roll" min="-360" init="0" max="360"/>
            <stage type="yRotate" name="Pitch" min="-360" init="0" max="360"/>
            <stage type="zRotate" name="Yaw" min="-360" init="0" max="360"/>
            <stage type="xTranslate" name="MoveX" min="-1000" init="0" max="1000"/>
            <stage type="yTranslate" name="MoveY" min="-1000" init="0" max="1000"/>
            <stage type="zTranslate" name="MoveZ" min="-1000" init="0" max="1000"/>
         </articulation>
         <articulation id="Logo" type="transform">
            <stage type="uniformScale" name="Size" min="0" init="1" max="1"/>
         </articulation>
         <articulation id="SolarPanel" type="transform">
            <stage type="yRotate" name="Fold" min="-90" init="0" max="0"/>
         </articulation>
         <articulation id="Thermal_Door" type="transform">
            <stage type="xRotate" name="Roll" min="-220" init="0" max="0"/>
         </articulation>
      </library_articulations>
   </technique>
</extra>

Ancillary Syntax in Ancillary File (*.anc)

<articulations>
   <articulation name = "HGA_Az" type = "transform">
      <stage init = "0" max = "72.5" min = "-182.5" name = "Roll" type = "xRotate" />
      <assigned_nodes>
         ParentLayer4_ikonos_M2L-Refer
      </assigned_nodes>
   </articulation>
   <articulation name = "HGA_El" type = "transform">
      <stage init = "0" max = "187.5" min = "-67.5" name = "Pitch" type = "yRotate" />
      <assigned_nodes>
         ParentLayer1_ikonos_M2L-Refer-3
      </assigned_nodes>
   </articulation>
   <articulation name = "Ikonos_1" type = "transform">
      <stage init = "1" max = "1" min = "0" name = "Size" type = "uniformScale" />
      <stage init = "0" max = "360" min = "-360" name = "Roll" type = "xRotate" />
      <stage init = "0" max = "360" min = "-360" name = "Pitch" type = "yRotate" />
      <stage init = "0" max = "360" min = "-360" name = "Yaw" type = "zRotate" />
      <stage init = "0" max = "1000" min = "-1000" name = "MoveX" type = "xTranslate" />
      <stage init = "0" max = "1000" min = "-1000" name = "MoveY" type = "yTranslate" />
      <stage init = "0" max = "1000" min = "-1000" name = "MoveZ" type = "zTranslate" />
      <assigned_nodes>
         ikonos_M2L_ROOT-Refer
      </assigned_nodes>
   </articulation>
   <articulation name = "Logo" type = "transform">
      <stage init = "1" max = "1" min = "0" name = "Size" type = "uniformScale" />
      <assigned_nodes>
         ParentLayer1_ikonos_M2L-Refer
      </assigned_nodes>
   </articulation>
   <articulation name = "SolarPanel" type = "transform">
      <stage init = "0" max = "0" min = "-90" name = "Fold" type = "yRotate" />
      <assigned_nodes>
         IncludeLayer6_ikonos_M2L-Refer
         IncludeLayer6_ikonos_M2L-Refer-2
         IncludeLayer6_ikonos_M2L-Refer-3
      </assigned_nodes>
   </articulation>
   <articulation name = "Thermal_Door" type = "transform">
      <stage init = "0" max = "0" min = "-220" name = "Roll" type = "xRotate" />
      <assigned_nodes>
         ParentLayer1_ikonos_M2L-Refer-2
      </assigned_nodes>
   </articulation>
</articulations>

Sensor Attach Points

Sensor attach points are used for attaching STK sensors to the 3D model.

Ancillary Syntax in COLLADA (*.dae)

<node id="AP13_HGA_AP">
   ..............
      <extra type="attach_point">
         <technique profile="AGI">
            <sensor_attach_point/>
         </technique>
      </extra>
   ..............
</node>

Ancillary Syntax in Ancillary File (*.anc)

<sensor_origins>
   AP13_HGA_AP
</sensor_origins>

Effect Attach Points

Effect attach points are used for attaching vapor trails to the 3D model.

Ancillary Syntax in COLLADA (*.dae)

<node id="AP13_HGA_AP">
   ..............
   <extra type="attach_point">
      <technique profile="AGI">
         <effect_attach_point/>
      </technique>
   </extra>
   ..............
</node>

Ancillary Syntax in Ancillary File (*.anc)

<effect_origins>
   AP13_HGA_AP
</effect_origins>

Pointable Elements

Pointable elements are components (e.g., radio dishes, cameras, and sun tracking panels) that can automatically point to and target other objects.

Ancillary Syntax in COLLADA (*.dae)

<node id="ParentLayer1_ikonos_M2L-Refer-3">
   .............
   <extra type="attach_point">
      <technique profile="AGI">
         <pointing_attach_point>
            <pointable_vector>
            0 0 1
            </pointable_vector>
         </pointing_attach_point>
      </technique>
   </extra>
   ..............
</node>

Ancillary Syntax in Ancillary File (*.anc)

<pointing_data>
   <pointing node = "ParentLayer1_ikonos_M2L-Refer-3" vector = "0 0 1" />
</pointing_data>

Solar Panel Groups

Solar Panel Groups are components defined as solar panels and assigned an efficiency value. This is useful when running the STK solar panel tool.

Ancillary Syntax in COLLADA (*.dae)

<node id="SolarPanel-PolygonMesh">
   ......................
   <extra type="attach_point">
      <technique profile="AGI">
         <solar_panel group="Ikonos" efficiency="14"/>
      </technique>
   </extra>
   ......................
</node>

Ancillary Syntax in Ancillary File (*.anc)

<solar_panel_groups>
   <solar_panel_group efficiency = "14" name = "Ikonos">
      <assigned_nodes>
         SolarPanel-PolygonMesh
      </assigned_nodes>
   </solar_panel_group>
</solar_panel_groups>

Non-obscuring Material

Non-obscuring materials are components (e.g., secondary mirrors, and radar domes) that are invisible to sensors. This is useful when running the STK sensor obscuration tool.

Ancillary Syntax in COLLADA (*.dae)

<node id="Camera-PolygonMesh">
   ............................
   <extra type="attach_point">
      <technique profile="AGI">
         <no_obscuration/>
      </technique>
   </extra>
   ............................
</node>

Ancillary Syntax in Ancillary File (*.anc)

<no_obscuration_nodes>
   Camera-PolygonMesh
</no_obscuration_nodes>

Collada does not contain the equivalent BoundRadius keyword from the MDL format. The bound radius is automatically computed with COLLADA models but not with MDL.

Advanced Shading

Collada models also support the ColladaFX framework, which allows users to write GLSL code to calculate vertex positions, pixel colors, etc. This allows for models to exhibit lighting properties of materials such as metal, glass, plastic, etc. ColladaFX also allows changing OpenGL States, use of all supported OpenGL Texture types (1D, 2D, 3D, cubemap, rectangle, shadow), and render to texture for use with multipass rendering techniques.

Satellite that uses a metallic BRDF based on the work of Ashikhmin and Shirley. The paper can be found here.

Within your shader code, you have access to scene data that is useful for shading your model. We refer to these as Preset Uniforms because they are accessed as uniform variables in your vertex or fragment shader. These variables must be declared as uniforms and then can be used. Here is an example using Insight3D's animation time to move a vertex.

GLSL

uniform float agi_Time;
uniform float fullOffset;
// Vertex Shader that oscillates from position to position+fullOffset along the Z axis.
void main()
{
    // Get fractional part of time
    float t = fract(agi_Time);
    // Move apply modelview and projection
    vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
    // Move vertex a certain percentage of offset
    pos.z += fullOffset * t;
    // Set position
    gl_Position = pos;
}

Preset Uniforms

Preset UniformTypeDescription
agi_ActiveLightsbool[gl_MaxLights]Light i is active if agi_ActiveLights[i] is true and inactive if false. Light properties can be accessed through gl_LightSources.
agi_CameraPositionvec3Position of the camera relative to the model's reference frame.
agi_CentralBodyDepthTexture0,
agi_CentralBodyDepthTexture1,
...,
agi_CentralBodyDepthTexture7
sampler2DA texture that contains the depth values after rendering the Central Body. The number binds the texture to a particular texture unit. See example image below.
agi_LightingEnabledfloat1 if lighting is enabled and 0 otherwise
agi_LODGeometricToleranceOverDistancefloatWhen multiplied by the distance from the vertex or fragment to the viewer, the result is the geometric error in world space.
agi_LODNegativeGeometricToleranceOverDistancefloatNegative of agi_LODGeometricToleranceOverDistance
agi_ModelViewMatrixmat4Modelview matrix
agi_ModelViewMatrixRelativeToCameraPositionmat4Modelview matrix relative to the camera position
agi_ModelViewMatrixRelativeToPrimitiveCentermat4Modelview matrix relative to the model's center
agi_ModelViewProjectionMatrixmat4Modelview projection matrix
agi_ModelViewProjectionMatrixRelativeToCameraPositionmat4Modelview projection matrix relative to the camera position
agi_ModelViewProjectionMatrixRelativeToPrimitiveCentermat4Modelview projection matrix relative to the model's center
agi_OrthographicProjectionMatrixmat4Orthographic projection matrix
agi_PerspectiveProjectionMatrixmat4Perspective projection matrix
agi_PrimitiveBoundingSpherevec4The model's bounding sphere relative to the model's reference frame. The structure is xyz components are the position and w is the radius in meters.
agi_PrimitiveBoundingSphereRelativeToCameraPositionvec4The model's bounding sphere relative to the camera position. The structure is xyz components are the position and w is the radius in meters.
agi_PrimitiveColorvec4The color of the primitive
agi_SnapshotPixelScalefloatScale for when rendering high resolution snap shots. Otherwise it is 1.
agi_TerrainSilhouetteTexture0,
agi_TerrainSilhouetteTexture1,
...,
agi_TerrainSilhouetteTexture7
sampler2DA texture that contains the silhouette of the terrain. The number binds the texture to a particular texture unit. See example image below.
agi_TimefloatNumber of seconds since the time specified to Animation StartTime property.
agi_Viewportvec4The viewport in the format (left, bottom, width, height)

Central Body rendered normallyCentral Body Depth Texture

Example of Terrain Silhouette Texture

OpenGL States

Supported OpenGL States

ColladaFX ElementOpenGL StateNotes
alpha_funcglAlphaFunc
alpha_test_enableglEnable/glDisable with GL_ALPHA_TEST
blend_colorglBlendColor
blend_enableglEnable/glDisable with GL_BLEND
blend_equationglBlendEquation
blend_equation_separateglBlendEquationSeparateRequires OpenGL 2.0
blend_funcglBlendFunc
blend_func_separateglBlendFuncSeparateRequires OpenGL 1.4
color_maskglColorMask
cull_faceglCullFace
cull_face_enableglEnable/glDisable with GL_CULL_FACE
depth_clamp_enableglEnable/glDisable with GL_DEPTH_CLAMP_NVRequires GL 3.2 or GL_ARB_depth_clamp
depth_funcglDepthFunc
depth_maskglDepthMask
depth_rangeglDepthRange
depth_test_enableglEnable/glDisable with GL_DEPTH_TEST
fog_colorglFogfv with GL_FOG_COLOR
fog_densityglFogf with GL_FOG_DENSITY
fog_enableglEnable/glDisable with GL_FOG
fog_endglFogf with GL_FOG_END
fog_modeglFogi with GL_FOG_MODE
fog_startglFogf with GL_FOG_START
front_faceglFrontFace
line_smooth_enableglEnable/glDisable with GL_LINE_SMOOTH
line_stippleglLineStipple
line_stipple_enableglEnable/glDisable with GL_LINE_STIPPLE
line_widthglLineWidth
point_sizeglPointSize
point_smooth_enableglEnable/glDisable with GL_POINT_SMOOTH
polygon_modeglPolygonModeOnly FRONT_AND_BACK
polygon_offsetglPolygonOffset
polygon_offset_fill_enableglEnable/glDisable with GL_POLYGON_OFFSET_FILL
scissorglScissor
scissor_test_enableglEnable/glDisable with GL_SCISSOR_TEST
shade_modelglShadeModel
stencil_funcglStencilFunc
stencil_func_separateglStencilFuncSeparateRequires OpenGL 2.0
stencil_maskglStencilMask
stencil_mask_separateglStencilMaskSeparateRequires OpenGL 2.0
stencil_opglStencilOp
stencil_op_separateglStencilOpSeparateRequires OpenGL 2.0
stencil_test_enableglEnable/glDisable with GL_STENCIL_TEST
texture1DglBindTexture with GL_TEXTURE_1D
texture2DglBindTexture with GL_TEXTURE_2D
texture3DglBindTexture with GL_TEXTURE_3D
textureCUBEglBindTexture with GL_TEXTURE_CUBE_MAPRequires OpenGL 1.3
textureDEPTHglBindTexture with GL_TEXTURE_2DUsed for depth textures.
textureRECTglBindTexture with GL_TEXTURE_RECTANGLE_ARB

Unsupported OpenGL States

ColladaFX ElementNotes
auto_normal_enable
clip_planeCan be emulated in the fragment shader. Removed from OpenGL 3.2 core.
clip_plane_enableCan be emulated in the fragment shader. Removed from OpenGL 3.2 core.
color_logic_op_enable Rarely used.
color_materialCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
color_material_enableCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
depth_boundsOnly affects performance, not the visual output. Not in core GL, requires EXT_depth_bounds_test.
depth_bounds_enableOnly affects performance, not the visual output. Not in core GL, requires EXT_depth_bounds_test.
dither_enableRarely used.
light_ambientCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_constant_attenuationCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_diffuseCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_enableCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_linear_attenuationCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_model_ambientCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_model_color_controlCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_model_local_viewer_enableCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_model_two_side_enableCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_positionCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_quadratic_attenuationCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_specularCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_spot_cutoffCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_spot_directionCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
light_spot_exponentCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
lighting_enableCan be emulated in fragment shader. Fixed function lighting was removed from OpenGL 3.2 core.
logic_opRarely used.
logic_op_enableRarely used.
material_ambientCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
material_diffuseCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
material_emissionCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
material_shininessCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
material_specularCan be emulated in the fragment shader by implementing a BRDF. Removed from OpenGL 3.2 core.
model_view_matrixCan be emulated in the shader. Removed from OpenGL 3.2 core.
multisample_enableRequires an OpenGL context be created with multisample buffers, which is currently not supported in Insight3D.
normalize_enableThis is always enabled.
point_distance_attenuation
point_fade_threshold_size
point_size_enable
point_size_max
point_size_min
polygon_offset_line_enable
polygon_offset_point_enable
polygon_smooth_enable
projection_matrixCan be emulated in the shader. Removed from OpenGL 3.2 core.
sample_alpha_to_coverage_enableRequires an OpenGL context be created with multisample buffers, which is currently not supported in Insight3D.
sample_alpha_to_one_enableRequires an OpenGL context be created with multisample buffers, which is currently not supported in Insight3D.
sample_coverage
sample_coverage_enable
texture_env_color Can be emulated in the fragment shader. Removed from OpenGL 3.2 core.
texture_env_color Can be emulated in the fragment shader. Removed from OpenGL 3.2 core.
texture_pipeline GLES profile only. GLSL is currently the only supported profile.
texture1D_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core
texture2D_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core
texture3D_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core
textureCUBE_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core
textureDEPTH_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core
textureRECT_enableThis isn't required when using a texture in a shader. Removed from OpenGL 3.2 core