Home> 4D Blocks > Version 1
|
Scene LanguageThe scripting language used to describe scenes is stack-based, like PostScript or Forth. You can comment and uncomment things in C/C++ style. Brackets are used to define arrays / vectors.The simplest command is just the name of a type of block, which creates a new block of that type at its default location (which should typically have coordinates ranging from 0 to 1). For example ...
block3When you have more than one block, you'll want them to be in different places. Here's how you create a block3 that's moved one unit in the x direction (i.e. to the right). There's no way to rotate blocks yet, but I'll probably add that some time soon.
block3 [1 0 0] translateYou can change the colors of blocks using the same kinds of colors as in HTML. The color-setting operation can come before or after translation, doesn't matter.
block3 #FF0000 shapecolorYou can change the colors of individual faces too. Faces are identified by numbers from 0 to N-1. You can figure out which faces are which by experimenting or by digging into the "library" file where they're defined.
block3 5 #FF0000 facecolorThat's all there is to know about editing the scene file, except, don't mix 3D and 4D blocks in the same scene. If you want to get into defining new block types, see the "library" file for examples. Here are a few hints about the format.
|