Previous Topic Tutorial Home Page Next Topic
Boiler Plates


import com.ms.dxmedia.*;
All direct Animation classes
import java.net.*;
the URL class
import java.awt.*;
the Dimension class
import utility.*;
the DraggableImage class

Splines is an applet that invokes SplinesModel to construct an interactive spline with the specified number of polynomial pieces
public class Splines extends DXMApplet {
public void init() {
super.init() ;
setModel (new SplinesModel(this, 4));
}
}


class SplinesModel extends Model {

SplinesModel(DXMApplet dxma, int numPolys) {
_numPolys = numPolys;

Get the size of the viewport.
Dimension dim = dxma.getSize();
The base unit of measure for DirectX Media is the meter. Convert the size into meters by multiplying it with the pixelBvr.
_halfWidth = mul(toBvr(dim.width*0.5),pixelBvr);
_halfHeight = mul(toBvr(dim.height*0.5),pixelBvr);
}

private NumberBvr _halfWidth; half width of viewport
private NumberBvr _halfHeight;
half height of viewport


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

Previous Topic Tutorial Home Page Next Topic