DAStatics Functions Relevant to DADXTransformResult Objects

ApplyDXTransformConstructs a DADXTransformResult object from the given DirectX transform.

ApplyDXTransform

DAStatics Class

Constructs a DADXTransformResult object from the given DirectX transform and its inputs. In script, you can only use DirectX transforms that support the IDispatch interface. To use transforms that don't support IDispatch, as well as those that do, use the COM method IDA2Statics::ApplyDXTransformEx.

You can only use this function with Microsoft® DirectAnimation® version 6.x or later. Note that to use 3-D DirectX Transform objects you must have Microsoft DirectX® 6.x or later installed. To use some 2-D DirectX Transform effects, you must have optional DLLs installed. You can install these by choosing "Optional Transforms" when you install the DirectX Media SDK. See Using DirectX Transform Effects for a complete list of DirectX Transform effects and what additional software, if any, is required to use each. Instantiation of the DirectX Transform COM object will fail if you attempt to use transforms without the proper software installed.

Syntax

lib.ApplyDXTransform( DXTf, inputs, evaluator )

Parameters

DXTf
DirectX transform to be used to create the DADXTransformResult object. The following code shows how to create this parameter.
DXTf = new ActiveXObject("DX3DTransform.Microsoft.Ripple");
inputs
Optional inputs (a VARIANT) to the DirectX transform, for example, two surfaces or a 3-D object. If you don't use this parameter, set it to null (JScript) or Null (VBScript).
evaluator
Definition (a VARIANT), that is usually a set of behaviors, describing how to map the DirectX transform progress to time. DirectX transforms measure progress from 0 to 1, with 1 being complete. You might, for example, create a behavior that increments from 0 to 1 over five seconds, then stays at 1 for two seconds, then decrements back to 0 in five seconds and repeats. If you assign this behavior as the evaluator, the transform will display the same progress over time, transforming completely in five seconds, staying in that state for two seconds, and so on. If you don't use this parameter, set it to null (the word null without quotation marks).

Return Value

Returns the DADXTransformResult object that is the result of the DirectX transform, its inputs, and the evaluator.

Remarks

The following example uses the Explode DirectX transform.

  m = DAControl.MeterLibrary;
  function simpleApply(progid, inputVal, evaluator) {
      xf = new ActiveXObject(progid);
      inputs = new Array(1);
      inputs[0] = inputVal;
      result = m.ApplyDXTransform(xf, inputs, evaluator);
      return result.OutputBvr;
  }
  boat = m.ImportGeometry("../../media/geometry/sailboat.x");

  // Construct a number that holds at 0 for three seconds, moves to 1
  // over three seconds, then comes back to 0 over three seconds, then
  // repeats.
  holdTime = m.DANumber(0).Duration(3);
  forward = m.Interpolate(0, 1, 3);
  back = m.Interpolate(1, 0, 3);
  evaluator =
  m.Sequence(holdTime, m.Sequence(forward, back)).RepeatForever();
  xformedGeo = simpleApply("DX3DTransform.Microsoft.Explode", boat, evaluator);
  //add code here for lights, camera, and rendering
  

Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.