Code: Select all
material
name invisible
diffuse 0 0 0 0
alphathresh 0.2
#noradar
#noshadow
#noculling
#nosorting
end
material
name thingy
diffuse 1 1 1 1
alphathresh 0.2
#noradar
#noshadow
#noculling
#nosorting
addtexture caution.png
end
mesh
# set the center of the collision box as an inside point
# since the collision volume is convex, a single point is fine
inside 0 0 1
# define a list of verts, normals ,and UVs
# these will be used by both the tradtional mesh faces
# as well as the draw info.
#verts 8
#norms 6
#uvs 4
vertex 1 1 2 #0
vertex 1 -1 2 #1
vertex -1 -1 2 #2
vertex -1 1 2 #3
vertex 1 1 0 #4
vertex 1 -1 0 #5
vertex -1 -1 0 #6
vertex -1 1 0 #7
normal 1 0 0 #0
normal -1 0 0 #1
normal 0 1 0 #2
normal 0 -1 0 #3
normal 0 0 1 #4
normal 0 0 -1 #5
normal 1 1 0 #6
normal -1 -1 0 #7
texcoord 0 0 #0
texcoord 1 0 #1
texcoord 1 1 #2
texcoord 0 1 #3
#These faces are just used for colisions
# it has a material set that is invisible.
# these are NORMAL faces, just like any other mesh
# these are attached to the MESH, not the draw info
# they must go ether before or after the draw info section
# and can NOT be animated, LODed, etc. They are normal mesh faces
face # top
vertices 3 2 1 0
texcoords 0 1 2 3
normals 4 4 4 4
matref invisible
endface
face # botom
vertices 4 5 6 7
texcoords 0 1 2 3
normals 5 5 5 5
matref invisible
endface
face # x+
vertices 0 1 5 4
texcoords 0 1 2 3
normals 0 0 0 0
matref invisible
endface
face # x-
vertices 7 6 2 3
texcoords 0 1 2 3
normals 1 1 1 1
matref invisible
endface
face # y+
vertices 4 7 3 0
texcoords 0 1 2 3
normals 2 2 2 2
matref invisible
endface
face # y-
vertices 1 2 6 5
texcoords 0 1 2 3
normals 3 3 3 3
matref invisible
endface
# this is the actual drawn geometry
drawInfo
# the info for the octree
# the min X Y Z and max X Y Z of all the verts in this section
extents -1 -1 0 1 1 2
# the center X Y Z and radus of a sphere that includes all verts in this section
sphere 0 0 1 4
# spin it 40 deg per second
angvel 40
# define a set of unique XYZ, IJK, UV indexes as corners
#-x y to +x -y
corner 3 6 0 #0
corner 1 6 1 #1
corner 5 6 2 #2
corner 7 6 3 #3
# since the back side has a different normal, we make a difrent set of corners
# each corner index represents a unique combination of vert, normal, and texture coordinates.
# you MUST define texture coordiantes and normals when doing draw info.
corner 7 7 3 #4
corner 5 7 2 #5
corner 1 7 1 #6
corner 3 7 0 #7
# do just one LOD that used always
# you can do more then one LOD level
# and use a rougher geometric representation for further distances.
# this is the best way to make complex meshes run better
lod # 0
lengthPerPixel 0 # 0 means that this is used as the nearest one
# this would be incrased for further LODs.
matref thingy # group the items that use the same texture
dlist # put it into a display list
sphere 0 0 1 4 # tell the octree how big this part is
polygon 0 1 2 3 # call 2 polygons, one for each side
polygon 4 5 6 7
# Note
# draw info only supports draw info specific geometric primitives.
# normal mesh primitives, like face, meshbox, arc, etc are NOT valid
# inside a draw info section.
# you must use one or more of the following draw commands, followed by
# a list of corner indexes.
# points, lines, lineloop, linestrip, tris, tristrip,
# trifan, quads, quadstrip, polygon
# the equivalent command for a mesh face would be the polygon
end
end
end
end