Language Definition
shape <name> ( <shape type> ) {
<shape options>
}
light <name> {
<light options>
}
node <name> ( <nodea> , <BOOLEAN OPERATOR>, <nodeb> ){ <node options> }
See an Example Input File
Naming
Names like the rest of the language are case independent (i.e. CHAIR is the same as chair is the same as ChAiR). A name can be any letter followed by any series of numbers or letters. Spaces and other characters are not valid and will cause an error. every shape and node must have a unique name. If you try to create a shape with a name already in use an error will be given.
Nodes
A node is a shape or result of boolean operations between shapes. Each node must have a unique name which allows it to be referenced
Objects
A number of objects go together to make up a model. This is a description of them and how they interact
Shapes |
---|
syntax: shape <name> ( <shape type> ) { <options> } A Shape is the basic building block for your model. Its the only thing that actually gets drawn to the screen. |
  |
Lights |
syntax: light <name> { <light options> } A Light provides illumination for your shapes. You can't actually see a light, only its affect on shapes around it. |
  |
Nodes |
syntax: node <name> ( <nodea> , <BOOLEAN OPERATOR> , <nodeb> ){ <node options> } A node is a way of combining shapes. nodea and nodeb in this context can be either other nodes or shapes. This way you can build up a tree like structure of combinations of shapes to give the end result |
  |
Startnode |
syntax: startnode <node> startnode is a special case. It does not create anything, it just points to a node (node or shape). You must set startnode to the top level node in your tree. If you don't define a nodestart, or if a shape isn't a leaf of the tree starting from nodestart then the shape/shapes will not be rendered. |
  |
comments
/* comments */ |
---|
anything surrounded by /* */ (C style comments) will be ignored |
  |
// comments |
anything after // until the end of the line will also be ignored (C++ style comments) |
  |
Shape Types
sphere |
---|
syntax: shape <name> ( sphere ) { <options> } |
  |
box |
syntax: shape <name> ( box ) { <options> } |
  |
cylinder |
syntax: shape <name> ( cylinder ) { <options> } |
  |
cone |
syntax: shape <name> ( cone ) { <options> } |
  |
hyperboloid |
syntax: shape <name> ( hyperboloid ) { <options> } |
  |
Shape Options
note The order that the translate, rotate, and scale operators DOES matter. The correct order is translate then rotate then scale. Other orders are valid but will produce strange results
translate |
---|
syntax: translate ( X , Y , Z ); x,y,z are double precision coordinates. |
  |
rotatex |
syntax: rotatex ( ø ); ø is an angle in degrees to rotate by. |
  |
rotatey |
syntax: rotatey ( ø ); ø is an angle in degrees to rotate by. |
  |
rotatez |
syntax: rotatez ( ø ); ø is an angle in degrees to rotate by. |
  |
scale |
syntax: scale ( X , Y , Z ); X,Y,Z are double precision numbers which scale alone the relevent axis. |
  |
color |
syntax: color( R , G , B ); R,G,B are the RED, GREEN and BLUE values that make up a color. |
  |
shine |
syntax: shine ( n ); n is a measure if the 'shineyness' of the object. |
  |
specular |
syntax: specular ( Ks ); Ks is a measure of how much of the incoming light is reflected in a specular (shiney) fashion. |
  |
diffuse |
syntax: diffuse ( Kd ); Kd is a measure of how much of the incoming light is reflected in a diffuse (matte) fashion. |
  |
transparency |
syntax: transparency ( T ); T is a measure of how much light passes through the shape. |
  |
reflection |
syntax: reflection ( R ); R is a measure of how much light is reflected off the shape. |
  |
density |
syntax: density ( D ); D is a measur of how 'dense' a shape is (thus how much light refracts when passing through it) |
  |
Light Options
color |
---|
syntax: color ( R , G , B ); |
  |
position |
syntax: position ( X , Y , Z ); |
  |
intensity |
syntax: intensity ( I ); |
  |
Boolean Operators
add |
---|
syntax: node <name> ( <nodea> , add , <nodeb> ){ <node options> } |
  |
subtract |
syntax: node <name> ( <nodea> , subtract , <nodeb> ){ <node options> } |
  |
intersect |
syntax: node <name> ( <nodea> , intersect , <nodeb> ){ <node options> } |
  |
Node Options
translate |
---|
syntax: translate ( X , Y , Z ); x,y,z are double precision coordinates. |
  |
rotatex |
syntax: rotatex ( ø ); ø is an angle in degrees to rotate by. |
  |
rotatey |
syntax: rotatey ( ø ); ø is an angle in degrees to rotate by. |
  |
rotatez |
syntax: rotatez ( ø ); ø is an angle in degrees to rotate by. |
  |
scale |
syntax: scale ( X , Y , Z ); X,Y,Z are double precision numbers which scale alone the relevent axis. |
  |