Mesh Object
Work In Progress
We are working on updating and improving this documentation. Some information may be missing or inaccurate.
Attributes
The mesh object supports the following attributes:
| Syntax | Description |
|---|---|
| name <name> |
Sets the name of this object. In many cases, this does not have any purpose and may just be useful for documenting what the object is for. In some case, like for teleporters, this can be used to reference the object from other objects. |
| position <x> <y> <z> |
This controls the absolute position of the object, lined up with the bottom center of the object. The center of the world, at ground level, is 0 0 0. |
| size <x> <y> <z> |
This controls the size of the object. It accepts three floating point numbers for the X, Y, and Z size of the object. Z is up. |
|
rot <angle> rotation <angle> |
Objects can be rotated on the Z axis, with the angle being specified in degrees. Extremely old worlds may use radians and will need to be converted, since BZFlag 1.7e0 used radians, and this was changed to use degrees in BZFlag 1.7e4. |
| shift <x> <y> <z> |
This shifts the relative position of an object. |
| scale <x> <y> <z> |
This scales an object up or down in the x, y, and/or z direction, with 1 being 100%. |
| shear <x> <y> <z> | |
| spin <angle> <x> <y> <z> | |
| xform <transform_name> |
The xform attribute applies the transformations of a transform to an object. You provide the name of the transform object. |
| vertex <x> <y> <z> |
This defines a point in 3D space. These points are indexed (or numbered) starting with 0, which will be referenced in mesh faces when specifying the vertices. |
| normal .......... | |
| texcoord ......... | |
| inside <x> <y> <z> |
This defines a point in 3D space, and it should be a point that is inside the mesh object. This helps build a collision model that ensure that the "inside" of the mesh is solid. Usually only one inside or outside point is needed. |
| outside <x> <y> <z> |
This defines a point in 3D space, and it should be a point that is outside the mesh object. This helps build a collision model that ensure that the "inside" of the mesh is solid. Usually only one inside or outside point is needed. |
| face |
This starts a mesh face |
| vertices <int> <int> <int...> | |
| normals <int> <int> <int...> | |
| texcoords <int> <int> <int...> | |
| phydrv <driver_name> |
Applies a physics driver named as provided, which alter the physics of a tank when they touch the object. Examples of physics drivers are bounce pads, conveyor belts, and death. You provide the name of the physics driver object. |
| endface |
This ends a mesh face |
| matref <material_name> |
The matref attribute applies a material to the object. You provide the name of the material object. |
| resetmat | |
| dyncol <dynamic_color_name> | |
|
ambient <red> <green> <blue> [alpha] ambient <color_name> [alpha] |
|
|
diffuse <red> <green> <blue> [alpha] diffuse <color_name> [alpha] color <red> <green> <blue> [alpha] color <color_name> [alpha] |
|
|
specular <red> <green> <blue> [alpha] specular <color_name> [alpha] |
|
|
emission <red> <green> <blue> [alpha] emission <color_name> [alpha] |
|
| shininess <float> | |
| alphathresh <value> | |
| noculling | |
| nosorting | |
| noradar | |
| noshadow | |
| nolighting | |
| occluder | |
| groupalpha | |
| texture <texture_name> | |
| notextures | |
| addtexture <texture_name> | |
| texmat <matrix_name> | |
| notexalpha | |
| notexcolor | |
| spheremap | |
| phydrv <driver_name> |
Applies a physics driver named as provided, which alter the physics of a tank when they touch the object. Examples of physics drivers are bounce pads, conveyor belts, and death. You provide the name of the physics driver object. |
This content is maintained on GitHub. We welcome any feedback and improvements!