Keywords: {define, copy}
Define is a keyword used to create a shape that you will be creating multiple copies of so that you don't have to keep retyping the same parameters.
The syntax of define is:
define name [shape_type] [parameter 1] ... [parameter n]
For example, if you wanted to create 5 red cubes that all have similar parameters, here is how define would make your life easier:
The syntax of define is:
define name [shape_type] [parameter 1] ... [parameter n]
For example, if you wanted to create 5 red cubes that all have similar parameters, here is how define would make your life easier:
cube material=Red scale=10,10,10 mass=1.5 location=0,0,0
cube material=Red scale=10,10,10 mass=1.5 location=50,0,0
cube material=Red scale=10,10,10 mass=1.5 location=100,0,0
cube material=Red scale=10,10,10 mass=1.5 location=150,0,0
cube material=Red scale=10,10,10 mass=1.5 location=200,0,0
cube material=Red scale=10,10,10 mass=1.5 location=50,0,0
cube material=Red scale=10,10,10 mass=1.5 location=100,0,0
cube material=Red scale=10,10,10 mass=1.5 location=150,0,0
cube material=Red scale=10,10,10 mass=1.5 location=200,0,0
would become ...
define redcube cube material=Red scale=10,10,10 mass=1.5
redcube location=0,0,0
redcube location=50,0,0
redcube location=100,0,0
redcube location=150,0,0
redcube location=200,0,0
redcube location=0,0,0
redcube location=50,0,0
redcube location=100,0,0
redcube location=150,0,0
redcube location=200,0,0
Copy is a keyword used to make multiple copies of a group of shapes.
The syntax of copy is:
copy [group_name] [offset] [flags]
The group name is the group that can be passed in when creating shapes. The offset is a set of 3 floats, specifying the offset in the x, y, and z planes. So to move the shape 50 in the x plane, the offset would be 50,0,0. There are 3 possible flags that can be passed to the copy command:
flipx - flips all copied shapes over the x axis
flipy - flips all copied shapes over the y axis
keepgroups - the copied shapes will have the same groups as the original shapes (otherwise by default they will not have the group that is being copied on)
Here is an example of how useful the copy command is to make a row of trees:
The syntax of copy is:
copy [group_name] [offset] [flags]
The group name is the group that can be passed in when creating shapes. The offset is a set of 3 floats, specifying the offset in the x, y, and z planes. So to move the shape 50 in the x plane, the offset would be 50,0,0. There are 3 possible flags that can be passed to the copy command:
flipx - flips all copied shapes over the x axis
flipy - flips all copied shapes over the y axis
keepgroups - the copied shapes will have the same groups as the original shapes (otherwise by default they will not have the group that is being copied on)
Here is an example of how useful the copy command is to make a row of trees:
cylinder material=Wood location=-4000,-3400,154 scale=64,64,300 group=tree group=treerow
sphere material=Green location=-4000,-3400,379 scale=250,250,250 group=tree group=treerow
copy tree 0,800,0
copy treerow -500,0,0 keepgroups
copy treerow -1000,0,0 keepgroups
sphere material=Green location=-4000,-3400,379 scale=250,250,250 group=tree group=treerow
copy tree 0,800,0
copy treerow -500,0,0 keepgroups
copy treerow -1000,0,0 keepgroups