DrawInfo

From BZFlagWiki
Revision as of 03:12, 11 September 2007 by Tedius (Talk | contribs) (here's a start at least)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Drawinfo allows clients to render mesh more efficiently through LOD's (Level of Detail). Many associate drawinfo with the ability to create moving objects in a map.

Code

The code must be added to the mesh object.

 drawInfo
   dlist		      # display list for all material sets
   decorative		      # older clients with not see this mesh
   angvel <degrees/sec>       # rotation about initial Z axis
   extents <minX> <minY> <minZ> <maxX> <maxY> <maxZ>
   sphere <x> <y> <z> <radiusSquared>
   corner <v> <n> <t>	      (repeatable)
   vertex 0.0 0.0 0.0	      (repeatable)
   normal 0.0 0.0 0.0	      (repeatable)
   texcoord 0.0 0.0	      (repeatable)
   lod			      (repeatable)
     lengthPerPixel <value>
     matref <name>	      (repeatable)
       dlist		      # display list for this material set
       sphere <x> <y> <z> <radiusSquared>
       points	 0	      (repeatable)
       lines	 0 1	      (repeatable)
       lineloop  0 1	      (repeatable)
       linestrip 0 1	      (repeatable)
       tris	 0 1 2	      (repeatable)
       tristrip  0 1 2	      (repeatable)
       trifan	 0 1 2	      (repeatable)
       quads	 0 1 2 3      (repeatable)
       quadstrip 0 1 2 3      (repeatable)
       polygon	 0 1 2	      (repeatable)
     end  # matref
   end	  # lod
 end	  # drawInfo

Valid parameters for drawinfo are:

dlist
decorative disables drawinfo in older clients
angvel causes the mesh object to spin at a given rate
extents
sphere
corner this is a series of points specified by the indexes of the vertices, normals, and texcoords
vertex
normal
texcoord
lod sections that determine which faces/points will be rendered at specified distances (lengthPerPixel)
lengthPerPixel distance from which the points will be rendered, 0 is close, .3 is about as far away as is needed
matref material to use as defined in the materials object
points
lines
lineloop
linestrip
tris index numbers of corners that create triangles
tristrip series of points that form a chain of triangles.
trifan a series of points that create triangles that fan out from a single point. That point, usually in the center, is placed first in the series
quads points that create 4-sided mesh planes
quadstrip series of points that create a chain of 4-sided planes. Similarly to tristrips, the series zig-zags between the points, starting in the counter-clockwise direction.
polygon same as quads except for planes of more than 4 sides.