Create the DlxSurface object.
Syntax: |
new DlxSurface(shape, style, bTop=true)
|
Parameters
Parameter |
Description |
shape |
A DlxFigure object with the shape. |
style |
A Dlx3DStyle object or the index of the style. There are 10 styles available with indexes from 0 to 9. |
bTop |
Specify true if the bright face is the upper face. |
Remarks
You can add holes in the surface with AddHole. To finish the construction of the surface, call End.
Example
|
Copy code
|
function OnBuild3DModel()
{
var ctx = FWiz.Get3DModelCtx();
var style = FWiz.Get3DStyle(0);
style.SetStyle("gold");
var shape = new DlxFigure();
shape.SetRectangle(0, 0, 20, 20, -25, -25, 30, 30);
shape.EndShape();
var hole = new DlxFigure();
hole.AddArc(new DlxPoint(0, 0), 5);
hole.EndShape();
var obj = new DlxSurface(shape, style);
obj.AddHole(hole);
obj.End();
obj.Rotate(0, 45, 0);
ctx.Add(obj);
}
|
See also