G


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

You can import a geometry into DirectAnimation from a URL or local file. DirectAnimation supports the DirectX .X file format. In Java, build your URL base, then use the importGeometry method to import a geometry:


   //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"));

Here is an example of 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");

Here is an example of how to import a geometry over a network:


 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, it is necessary to 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.

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