 |
 |
|
 | |
Primitives Tutorial
Plane
Draws a plane on the XZ axis with a center on (0,0,0).

The set of properties for a plane model resource are:
| Name | Default | Description | Range |
| length | 1.0 | The size of the plane along the Z axis | Any float larger than zero |
| width | The size of the plane along the X axis |
| lengthVertices | 2 | The number of subdivisions along a dimension. The higher the number, the larger the number of triangles used to draw the plane. Setting this value has implications on the performance. If you're not using wireframe mode or want to have lighting effects (using Directors lights) then stick to the default. | Any integer equal to or larger than 2 |
| widthVertices |
In order to retrieve the actual value of the length of a model resource called "aPlane" you could write something like:
len = member("world").modelResource("aPlane").length
The following script creates a plane 50x50. To try it create a new movie, add a Shockwave 3D member to the score, name it "world" and attach this script to the sprite.
on beginSprite me
w = member("world")
w.resetWorld()
mr = w.newModelResource("aPlane",#plane,#both)
mr.length = 50
mr.width = 50
mr.LengthVertices = 2
mr.WidthVertices = 2
m = member("world").newModel("aPlaneInstance",mr)
-- rotate the plane -45 degress on the X axis
m.rotate(-45,0,0)
end
|