[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.7.1.2 Syntax

Written by numerous Crystal Space developers. Extensive Texinfo typesetting performed by Eric Sunshine, sunshine@sunshineco.com.

Basic Syntax Elements

number

A general number.

pos-number

A general positive number.

integer

A general integer.

pos-integer

A positive integer (> 0).

number..number

A numeric range. For example, `0..1' represents a number between 0 and 1.

name

A name identifier. An unquoted string provided that it contains no punctuation or whitespace; otherwise delimited by double quotes.

string

A string delimited by double quotes. Special characters are escaped with a backslash.

Number List

number-list => number [ `,' number ] ...

Boolean Value

yes => `yes' | `true' | `on' | `1'
no => `no' | `false' | `off' | `0'
yes-no => yes | no

Color Description

red => 0..1
green => 0..1
blue => 0..1
color => red `,' green `,' blue

Vectors and Coordinates

Note that the x-axis points to the right, the y-axis points up, and the z-axis points forward.

x => number
y => number
z => number
u => number
v => number
vector-2d => x `,' z
vector-3d => x `,' y `,' z
vector-4d => x `,' y `,' z `,' r
vertex-idx => integer
coordinate => vector-3d
coordinate-2d => vector-2d
texture-coordinate => u `,' v

Object Names

sector-name => name
light-name => name
thing-name => name
thingtpl-name => name
plane-name => name
col-name => name
script-name => name
texture-name => name
material-name => name
polygon-name => name
mesh-name => name
meshfact-name => name
library-name => name
file-name => name

Attributes and Numbers

max-textures-nr => pos-integer
radius => pos-number
texture-length => pos-number
height-nr => number
angle => number
light-index => `0' | pos-integer
vertex-index => `0' | pos-integer
keyname => string
keyvalue => string

BSP Tree

bsp => `BSP' `(' `)'
statbsp => `STATBSP' `(' `)'

Key

key => `KEY' `(' keyname `,' keyvalue `)'

Lighting Primitives

tex-lighting => `TEXTURE_LIGHTING' `(' yes-no `)'
lighting => `LIGHTING' `(' yes-no `)'

Rooms

dim => `DIM' `(' x `,' y `,' z `)'
height => `HEIGHT' `(' height-nr `)'
floor-height => `FLOOR_HEIGHT' `(' height-nr `)'

Fog

density => number
fog-desc => `FOG' `(' color `,' density `)'
alpha-nr => `0' | `25' | `50' | `75'
alpha => `ALPHA' `(' alpha-nr `)'

Vertex and Vector

vertex => `VERTEX' `(' coordinate `)'
vector => `V' `(' vector-3d `)'
quaternion => `Q' `(' vector-4d `)'

Matrices, Vectors, Scalers, and Angles

matrix-scaler => number
matrix-x-scaler => matrix-scaler
matrix-y-scaler => matrix-scaler
matrix-z-scaler => matrix-scaler
stated-matrix-x-scaler => `SCALE_X' `(' matrix-x-scaler `)'
stated-matrix-y-scaler => `SCALE_Y' `(' matrix-y-scaler `)'
stated-matrix-z-scaler => `SCALE_Z' `(' matrix-z-scaler `)'
complex-matrix-scaler => stated-matrix-x-scaler
        | stated-matrix-y-scaler
        | stated-matrix-z-scaler
full-matrix-scaler => matrix-x-scaler `,' matrix-y-scaler `,' matrix-z-scaler
uniform-matrix-scaler => matrix-scaler
simple-matrix-scaler => `SCALE' `(' uniform-matrix-scaler | full-matrix-scaler `)'
compound-matrix-scaler => simple-matrix-scaler | complex-matrix-scaler

rotation-x-angle => angle
rotation-y-angle => angle
rotation-z-angle => angle
rotation-x-matrix => `ROT_X' `(' rotation-x-angle `)'
rotation-y-matrix => `ROT_Y' `(' rotation-y-angle `)'
rotation-z-matrix => `ROT_Z' `(' rotation-z-angle `)'
complex-rotation-matrix => rotation-x-matrix | rotation-y-matrix | rotation-z-matrix
rotation-angles => rotation-x-angle `,' rotation-y-angle `,' rotation-z-angle
simple-rotation-matrix => `ROT' `(' rotation-angles `)'

rotation-matrix => simple-rotation-matrix | complex-rotation-matrix
complex-matrix => rotation-matrix | compound-matrix-scaler
simple-scaled-matrix => uniform-matrix-scaler
normal-matrix => vector-3d `,' vector-3d `,' vector-3d
identity-matrix => `IDENTITY'
matrix-type => identity-matrix
        | normal-matrix
        | simple-scaled-matrix
        | complex-matrix
matrix => `MATRIX' `(' [ matrix-type ... ] `)'

Planes

plane-desc-comp => plane-orig
        | plane-first-len
        | plane-first
        | plane-second-len
        | plane-second
        | matrix
        | vector
        | plane-uvec
        | plane-vvec
plane-desc => `PLANE' plane-name `(' [ plane-desc-comp ... ] `)'

Texturing: Planes and Polygons

plane-orig => `ORIG' `(' vector-3d | vertex-idx `)'
plane-first => `FIRST' `(' vector-3d | vertex-idx `)'
plane-second => `SECOND' `(' vector-3d | vertex-idx `)'
plane-first-len => `FIRST_LEN' `(' texture-length `)'
plane-second-len => `SECOND_LEN' `(' texture-length `)'
plane-uvec => `UVEC' `(' vector-3d `)'
plane-vvec => `VVEC' `(' vector-3d `)'
uv-shift => `UV_SHIFT' `(' texture-coordinate `)'
txt-uv => `UV' `(' vertex-idx texture-coordinate vertex-idx texture-coordinate vertex-idx texture-coordinate `)'
polytext-comp => plane-orig
        | plane-first-len
        | plane-first
        | plane-second-len
        | plane-second
        | matrix
        | vector
        | texlen
        | plane
        | plane-uvec
        | plane-vvec
        | uv-shift
        | txt-uv
polygon-texture => `TEXTURE' `(' [ polytext-comp ... ] `)'

Texturing: Bezier Patches

beziertext-comp => plane-orig
        | plane-first-len
        | plane-first
        | plane-second-len
        | plane-second
        | matrix
        | vector
        | texlen
        | uv-shift
        | plane-uvec
        | plane-vvec
bezier-texture => `TEXTURE' `(' [ beziertext-comp ... ] `)'

Portals

portal => `PORTAL' `(' sector-name `)'

after-vector => `W' `(' vector-3d `)'
warp-mirror => `MIRROR' `(' `)'
warp-static => `STATIC' `(' `)'
portal-clip => `CLIP' `(' `)'
portal-zfill => `ZFILL' `(' `)'
warp-comp => matrix
        | vector
        | after-vector
        | warp-mirror
        | warp-static
        | portal-clip
        | portal-zfill
warp => `WARP' `(' [ warp-comp ... ] `)'

move-comp => matrix | vector
move2 => `MOVE' `(' [ move-comp ... ] `)'
move => `MOVE' `(' matrix vector `)'
hardmove => `HARDMOVE' `(' [ move-comp ... ] `)'

Rooms

floor => `FLOOR' `('
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)' `)'
ceiling => `CEILING' `('
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)' `)'
floor-ceil => `FLOOR_CEILING' `('
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)'
        `(' coordinate `)' `)'

Circle of Vertices

This command is a short-cut for specifying some vertices in a circular pattern. Internally it is exactly the same as using the `VERTEX (...)' expression multiple times for the points around a circle.

radiusx => number
radiusy => number
radiusz => number
num-verts => integer
circle => `CIRCLE' `(' coordinate `:' radiusx `,' radiusy `,' radiusz `,' num-verts `)'

Sky Dome (Half Sphere)

A skydome is a short-cut for creating a complex half-sphere with gouraud shaded triangles. Note that you need to generate the first circle of vertices using the `CIRCLE' macro.

skydome-radius => `RADIUS' `(' radius `)'
skydome-vertices => `VERTICES' `(' vertex-index ... `)'
skydome-comp => skydome-radius | skydome-vertices | lighting
skydome => `SKYDOME' `(' [ skydome-comp ... ] `)'

Lights

dynamic-flag => `0' | `1'
light-oldsyntax => coordinate `:' radius `,' color `,' dynamic-flag

light-center => `CENTER' `(' coordinate `)'
light-radius => `RADIUS' `(' radius `)'
light-color => `COLOR' `(' color `)'
light-dynamic => `DYNAMIC' `(' `)'
light-halo => `HALO' `(' `)'
light-comp => light-center
        | light-radius
        | light-dynamic
        | light-color
        | light-halo
light-newsyntax => [ light-comp ... ]

light => `LIGHT' light-name `(' light-oldsyntax | light-newsyntax `)'

Bezier Curve

bezier-comp => texnr | material | bezier-texture | vertices
bezier => `BEZIER' `(' [ bezier-comp ... ] `)'

Polygons

The list of vertices is a list of vertex indices. These indices are relative to the list of vertices of the parent object (a Sector, Thing, or Thing Template). The first vertex in the parent object has index 0. The vertices of a polygon must be defined in clock-wise ordering as seen from a position from where you want the polygon to be visible.

vertices => `VERTICES' `(' vertex-index ... `)'

uva-scale => number
uva-offset => number
uva-spec => angle `,' uva-scale `,' uva-offset
uva => `UVA' `(' uva-spec ... `)'
uv => `UV' `(' texture-coordinate ... `)'

colors => `COLORS' `(' color ... `)'
gouraud => `GOURAUD' `(' `)'
flatcol => `FLATCOL' `(' color `)'

cosfact => `COSFACT' `(' number `)'
colldet => `COLLDET' `(' yes-no `)'

shading-comp => `NONE' | `FLAT' | `GOURAUD' | `LIGHTMAP'
shading => `SHADING' `(' shading-comp `)'

polygon-comp => texnr
        | material
        | lighting
        | portal
        | warp
        | polygon-texture
        | vertices
        | alpha
        | fog
        | uv
        | uva
        | colors
        | cosfact
        | gouraud
        | flatcol
        | mixmode
        | colldet
        | shading
polygon => `POLYGON' polygon-name `(' [ polygon-comp ... ] `)'

Polygon Templates

polygon-tpl-comp => texnr
        | material
        | lighting
        | polygon-texture
        | vertices
        | gouraud
        | flatcol
        | colldet
        | shading
        | colors
polygon-template => `POLYGON' polygon-name `(' [ polygon-tpl-comp ... ] `)'

Collection Objects

col-thing => `THING' `(' thing-name `)'
col-mesh => `MESH' `(' mesh-name `)'
col-collection => `COLLECTION' `(' col-name `)'
col-light => `LIGHT' `(' light-name `)'
col-sector => `SECTOR' `(' sector-name `)'
collection-comp => col-thing
        | col-collection
        | col-light
        | col-sector
        | col-mesh
collection => `COLLECTION' col-name `(' [ collection-comp ... ] `)'

Materials and Textures

material => `MATERIAL' `(' material-name `)'
texture => `TEXTURE' `(' texture-name `)'
ceil-texture => `CEIL_TEXTURE' `(' texture-name `)'
floor-texture => `FLOOR_TEXTURE' `(' texture-name `)'
texnr => `TEXNR' `(' texture-name `)' (Obsolete)
texlen => `LEN' `(' texture-length `)'
texture-scale => `TEXTURE_SCALE' `(' texture-length `)'

Material and Texture Description

transparent => `TRANSPARENT' `(' color `)'
procedural => `PROCEDURAL' `(' `)'
tex2d => `FOR_2D' `(' yes-no `)'
tex3d => `FOR_3D' `(' yes-no `)'
persistent => `PERSISTENT' `(' `)'
filter => `FILTER' `(' ... `)'
mipmap => `MIPMAP' `(' yes-no `)'
dither => `DITHER' `(' yes-no `)'
texture-file => `FILE' `(' file-name `)'

texture-desc-comp => transparent
        | filter
        | mipmap
        | dither
        | file
        | procedural
        | tex2d
        | tex3d
        | persistent
texture-desc => `TEXTURE' texture-name `(' [ texture-desc-comp ... ] `)'

material-desc-comp => texture
        | `COLOR' `(' color `)'
        | `DIFFUSE' `(' number `)'
        | `AMBIENT' `(' number `)'
        | `REFLECTION' `(' number `)'
material-desc => `MATERIAL' material-name `(' [ material-desc-comp ... ] `)'

Mesh Objects

plugin => `PLUGIN' `(' string `)'
params => `PARAMS' `(' string `)'

mesh-comp => plugin
        | key
        | params
        | mesh
        | move2
mesh => `MESHOBJ' mesh-name `(' [ mesh-comp ... ] `)'

Mesh Object Factories

meshfact-file => `FILE' `(' file-name `)'
meshfact-comp => plugin
        | params
        | meshfact-file
        | material
meshfact => `MESHOBJ' meshfact-name `(' [ meshfact-comp ... ] `)'

Things and Objects

moveable => `MOVEABLE' `(' `)'
detail => `DETAIL' `(' `)'
convex => `CONVEX' `(' `)'
template => `TEMPLATE' `(' thingtpl-name `)'
tex-select => `MAT_SET_SELECT' `(' mat-set-name `)'
thing-camera => `CAMERA' `(' `)'

thing-comp => vertex
        | polygon
        | texnr
        | material
        | texlen
        | key
        | bsp
        | move2
        | hardmove
        | template
        | fog-desc
        | moveable
        | detail
        | convex
        | circle
        | bezier
        | tex-select
        | thing-camera
thing => `THING' thing-name `(' [ thing-comp ... ] `)'
sky => `SKY' thing-name `(' [ thing-comp ... ] `)'

sixface-comp => move2
        | texture-scale
        | texture
        | ceil-texture
        | dim
        | height
        | floor-height
        | floor-ceil
        | floor-texture
        | floor
        | ceiling
        | moveable
        | detail
        | fog-desc
        | convex
sixface => `SIXFACE' thing-name `(' [ sixface-comp ... ] `)'

Thing and Object Templates

curve-center => `CURVECENTER' `(' coordinate `)'
curve-scale => `CURVESCALE' `(' number `)'
curve-control => `CURVECONTROL' `(' coordinate `:' texture-coordinate `)'
template-file => `FILE' `(' file-name `)'
thing-tpl-comp => vertex
        | polygon-template
        | texnr
        | material
        | texlen
        | move
        | fog-desc
        | circle
        | bezier
        | curve-center
        | curve-scale
        | curve-control
        | template-file
thing-template => `THING' thingtpl-name `(' [ thing-tpl-comp ... ] `)'

sixface-tpl-comp => move
        | texture-scale
        | texture
        | ceil-texture
        | dim
        | height
        | floor-height
        | floor-ceil
        | floor-texture
        | floor
        | ceiling
        | fog-desc
sixface-template => `SIXFACE' thingtpl-name `(' [ sixface-tpl-comp ... ] `)'

Nodes

position => `POSITION' `(' coordinate `)'
node-comp => position | key
node => `NODE' `(' [ node-comp ... ] `)'

Sectors and Rooms

tex-comp => texture | plane | texlen
tex => `TEX' `(' [ tex-comp ... ] `)'

portal-poly => `POLYGON' `(' polygon-name `)'
portal-sector => `SECTOR' `(' sector-name `)'
room-portal-comp => portal-poly | portal-sector | alpha | warp
room-portal => `PORTAL' `(' [ room-portal-comp ... ] `)'

split-direction => `VER' | `HOR'
split-list => number-list
split => `SPLIT' `(' polygon-name `,' split-direction `(' split-list `)' `)'

sector-comp => vertex
        | polygon
        | texnr
        | material
        | texlen
        | bsp
        | statbsp
        | thing
        | hardmove
        | sixface
        | light
        | mesh
        | fog-desc
        | circle
        | skydome
        | key
        | node
        | partsys
        | sky
sector => `SECTOR' sector-name `(' [ sector-comp ... ] `)'

room-comp => tex-lighting
        | texture-scale
        | texture
        | tex
        | ceil-texture
        | floor-texture
        | light
        | dim
        | height
        | floor-height
        | floor-ceil
        | floor
        | ceiling
        | sixface
        | thing
        | room-portal
        | split
        | partsys
        | sky
        | bsp
        | statbsp
        | move
        | mesh
        | fog-desc
room => `ROOM' sector-name `(' [ room-comp ... ] `)'

Texture List

textures-comp => texture-desc
textures => `TEXTURES' `(' [ textures-comp ... ] `)'

Material List

materials-comp => material-desc
materials => `MATERIALS' `(' [ materials-comp ... ] `)'

Material Groupings

Sometimes you want things of the same type but with different materials on it. This is where material groupings come in handy. The final name of a texture in a `MAT_SET' expression will be `mat-set-name_texture-name'. The materials will be merged into the global texture list. You should define a `MAT_SET' after `TEXTURES' since the latter command clears the internal list first. For usage of `MAT_SET' see the description of `THING'.

tex-set-name => name
texture-set => `MAT_SET' mat-set-name `(' materials `)'

Library

library => `LIBRARY' library-name `(' file-name `)'

Starting Position

start => `START' `(' sector-name `,' coordinate `)'

Skeletal Animation

euler => `EULER' `(' vector-3d `)'

anim-comp => euler
        | quaternion
        | matrix
motion-anim => `ANIM' `(' [ anim-comp ] `)'

anim-index => pos-integer
link => `LINK' bone-name `(' anim-index `)'
motion-frame => `FRAME' motion-time `(' [ link ... ] `)'

motion-comp => motion-anim
        | motion-frame
animation => `MOTION' motion-name `(' [ motion-comp ... ] `)'

World

world-comp => textures
        | materials
        | library
        | animation
        | sector
        | room
        | thing-template
        | sixface-template
        | meshfact
        | plane-desc
        | collection
        | start
        | key
world => `WORLD' `(' [ world-comp ... ] `)'

Library File

library-comp => textures | materials | thing-template | meshfact
library => `LIBRARY' `(' [ library-comp ... ] `)'


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html