-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- OBJ2BZW -- -- The obj2bzw program takes a WaveFront .obj model file as its input, -- and outputs a .bzw BZFlag world file. Based on mesh object names, mesh -- object geometry, and material names, it can generate most of the types -- of native bzflag objects that standard modelling tools do not support. -- It also supports using materials to assign per-face physics properties -- like drivethrough, shootthrough, and physics drivers. -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- RECOGNIZED GEOMETRY -- -- cuboid: hexagon with 3 sets of parallel faces -- quad_horiz: rectangle with a normal along the Z axis -- quad_vert: rectangle with a normal perpendicular to the Z axis -- tri_vert: triangle with a normal perpendicular to the Z axis -- line_horiz: 3 collinear points along the Z axis -- line_vert: 3 collinear points perpendicular to the Z axis -- arrow: two triangles with a common edge, -- FIXME -- description -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Missing map object types: -- -- waterLevel (not directly tied to geometry, equiv. to a death phydrv) -- transform (rarely used) -- arc, cone, sphere, tetra, meshbox, meshpyr (not worth the bother) -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- MATERIAL FORMAT --------------- '('')'[...] '&' examples: red&DR - matref "red", make drivethrough (MR=red,DR) - equivalent to 'red&DR' newMat(DR,AT.2)_copy2 - the () format allows for trailing text MESH NAME FORMAT ---------------- DR - drivethrough SH - shootthrough PS - passable [name]'('s')'[...] '<'TYPE[':']'>'[]['('')'][...] * the typeprops can also include phyprops examples: tele1 _copy2 boxname()_copy2 (DR)_copy3 bouncy -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Solid objects -- BOX --- [name][(phyprops)][...] GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow PYR --- [name][(phyprops)][...] GEOMETRY: pyramid, quad_horiz, tri_vert, line_horiz, line_vert, arrow BASE ---- [name][(phyprops)][...] T - team number ONCAP - oncap weapon GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow TELE ---- name[(phyprops)][...] OFF - link faces' offset (along their normals) - the object name is mandatory Materials: * .TeleBack: quad (required, unique) * .TeleFront: quad (required, unique) GEOMETRY: cuboid, quad_vert MESH CHECK POINTS ----------------- Inside and Outside points can be added to meshes by including faces that use the InsidePointMaterial and OutsidePointMaterial. Materials: * .InsidePoint: arrow (optional, multiple) * .OutsidePoint: arrow (optional, multiple) GEOMETRY: arrow -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Unsolid objects -- COMMENT ------- Adds a comment into the world file, using underscores for spaces PHYSICS ------- name DEATH - underscore->space text LINEAR - underscore->space text SPIN - a numeric value, or '+d' or '-d' (for its triangle's height) Materials: * .PhysicsLinear: arrow (optional, unique) * .PhysicsSpinCenter: arrow (optional, unique) * .PhysicsSpinSpeed: arrow (optional, unique) GEOMETRY: arrow (.PhysicsLinear) GEOMETRY: arrow (.PhysicsSpinCenter) GEOMETRY: arrow (.PhysicsSpinSpeed) ZONE ---- [name] T - team number S - safety for flag F - flag ZF - zoneflag, optionally count GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow WEAPON ------ [name][(phyprops)][...] F - weapon flag type I - initdelay D - delay ET - event team TR - event trigger type GEOMETRY: arrow (NOTE: the arrow base is the weapon's position, not the tip) LINK ---- [name] If the SRC and DST are not specified, a triangle is used to connect the two teleporter faces. The link SRC face must share 2 vertices with the triangle, and the link DST face must share 1 vertex with the triangle. GEOMETRY: triangle (optional, unique) OPTIONS ------- [name] WORLD ----- [name] -- FIXME, desc TEXTURE MATRIX -------------- -- FIXME, desc .add("c", "center") .add("dsc", "scale") .add("dsp", "spin") .add("dsh", "shift") .add("fsc", "fixedscale") .add("fsp", "fixedspin") .add("fsh", "fixedshift"); DYNAMIC COLOR ------------- -- FIXME -- remove the 'dc' part from these abbrevs? -- FIXME, desc .add("dcrlm", "red limits") .add("dcglm", "green limits") .add("dcblm", "blue limits") .add("dcalm", "alpha limits") .add("dcrsn", "red sinusoid") .add("dcgsn", "green sinusoid") .add("dcbsn", "blue sinusoid") .add("dcasn", "alpha sinusoid") .add("dcrcu", "red clampUp") .add("dcgcu", "green clampUp") .add("dcbcu", "blue clampUp") .add("dcacu", "alpha clampUp") .add("dcrcd", "red clampDown") .add("dcgcd", "green clampDown") .add("dcbcd", "blue clampDown") .add("dcacd", "alpha clampDown") .add("dcrsq", "red sequence") .add("dcgsq", "green sequence") .add("dcbsq", "blue sequence") .add("dcasq", "alpha sequence"); -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Grouping -- GROUP DEFINITION ---------------- defname Materials: * .Origin: arrow (optional, unique) * Any Other Material: cuboid (required, unique) GEOMETRY: cuboid + optional arrow * all mesh objects completely contained within the group definition cuboid will become members of the definition (and will not be emitted into the output bzw file) GROUP INSTANCE -------------- [name] T - team TINT - the tinting color, underscores for spaces Materials: * .AxisX: quad (required, unique) * .AxisY: quad (required, unique) * .AxisZ: quad (required, unique) GEOMETRY: cuboid * the emitted group instance will be shifted, scaled, and rotated to transform the definition's cuboid into the instance's cuboid. -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- DrawInfo -- DRAWINFO TOP LEVEL ------------------ name Materials: * .Origin: arrow (optional, unique) * .DrawInfoSphere: arrow (optional, unique) * .DrawInfoExtents: cuboid (optional, unique) DRAWINFO LOD ------------ lodnames1 Materials: * .Origin: arrow (required, unique) * .DrawInfoSphere: arrow (optional, unique) * New Virtual Material Property: drawMode = < points | lines | faces > -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Materials -- FORMAT ------ red&DR - matref to "red", with drivethrough (REF=red,DR) - matref to "red", with drivethrough newmat(DR)_copy1 - a material with drivethrough ABBREVIATIONS ------------- MR=? - matref (? is a string) DR - drivethrough SH - shootthrough PS - passable SB - smoothbounce PD=? - phydrv (? is a string) NR - noradar NS - noshadow NST - nosorting NC - noculling NCL - noclusters NL - nolighting NT - notextures NTA - notexalpha NTC - notexcolor AG - grouped alpha OC - occluder SM - spheremap AT# - alphathresh (# is a floating point number) TM=? - texmat (? is a string) DC=? - dyncol (? is a string) DM=? - drawMode (? is a string, see the DrawInfo section) Special material names ---------------------- 1 .Null 2 .MateriaSwap 3 .PhysicsLinear 4 .PhysicsSpinCenter 5 .PhysicsSpinSpeed 6 .TeleFront 7 .TeleBack 8 .LinkSrc 9 .LinkDst 10 .XAxis 11 .YAxis 12 .ZAxis 13 .Origin 14 .InsidePoint 15 .OutsidePoint 16 .DrawInfoSphere 17 .DrawInfoExtents 18 .Void (void drawInfo geometry, or .Kill ???) 19 .Weapon ??? 20 .Zone ??? -------------------------------------------------------------------------------- --------------------------------------------------------------------------------