DirectAnimation Animated Header --G DirectAnimation Animated Header --G* Microsoft DirectAnimation SDK
*Contents  *Index  *Topic Contents
*Previous Topic: D
*Next Topic: I

G


geometry
Geometries have width, height, and depth, and are rendered into 2-D images. Geometries are objects of the DAGeometry (or Java GeometryBvr) class type, and are operated on by functions such as DAGeometry.Texture (or Java GeometryBvr.texture), DAGeometry.DiffuseColor (or Java GeometryBvr.diffuseColor), and DAGeometryBvr.Transform (or Java GeometryBvr.transform).

You can import a geometry into DirectAnimation from a URL or local file. DirectAnimation supports the DirectX .x file format. First build your URL base, then use the ImportGeometry function (or Java importGeometry method) to import a geometry, as shown in the following Java code:


   //Create a URL base
   URL geoBase = buildURL(getImportBase(),"file:/c:/DxM/Media/geometry/");
   // Create a geometry behavior by importing a geometry file
   GeometryBvr cube = importGeometry(buildURL(geoBase,"cube.x"));

The following example shows how to import a geometry from a local file, using JScript:


  mediaBase = "..\\..\\..\\..\\media\\";
  // the following form will also work as well
  // mediaBase = "file://c:\\dxm\\media\\";

  geoBase = mediaBase + "geo\\";
  myImage = m.ImportGeometry(geoBase + "cube.x");

The following example shows how to import a geometry over a network, using JScript:


 mediaBase = "http://dxmedia/directanimation/dxm_sdk/media/";
 geoBase = mediaBase + "geo/";
 myImage = m.ImportGeometry(geoBase + "cube.x");

You can augment a geometry with lights, including ambient, directional, point, and spot lights. (Because there is no default lighting, you must include some sort of lighting so that the geometry is visible.) You can also attach a sound source to a geometry to give the sound 3-D spatial characteristics. See Using Geometries for more information.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page