geometry

 

Tag: geometry
Parent tag: scene
Attributes:

  • name (string) – scene object’s name
  • type (enum) – the type of object. Valid values are {BOX, GRID, SPHERE, SQUARE, AXIS}
  • material (string) – the name of a material. Note: Axis has predefined materials
  • SLICES (float) – only for spheres, similar to glut*Sphere
  • STACKS (float) – only for spheres, similar to glut*Sphere
  • DIVISIONS (float) – only for grids, defines the number of cells in both horizontal dimensions (x,z)
  • LENGTH (float) – only for grids, defines the size of the grid in both horizontal dimensions (x,z)

Child tags:

  • TRANSFORM_ORDER (enum) – {T_R_S (default), T_S_R, R_T_S, R_S_T, S_T_R, S_R_T} defines the order of the geometric transformations
  • SCALE (vec3) – x, y, z
  • TRANSLATE (vec3) – x, y, z
  • ROTATE (vec3) – x, y, z, w, where (x,y,z) stand for the rotation axis and w stands for the angle in degrees

Geometry allows the creation of simple worlds with no 3D model file dependencies. It supports only a very limited number of primitives at the time.

Example:

<scenes>

	<scene name="CubeLand" type="Scene">
		<geometry name = "Sphere" type="SPHERE" material="crateBox" SLICES=15 STACKS=15 > 
			<TRANSLATE x =-2.5 y=0 z =0  />
			<SCALE x=1 y=1 z=2 />
		</geometry>								
		<geometry name = "Box" type = "BOX" material="crateBox"   >
			<TRANSLATE x =2.5 y=0 z =0  />
			<SCALE x=2 y=2 z=2 />
			<ROTATE x=0 y=1 z=0 w=45 />
		</geometry>
		<geometry name = "Grid" type = "GRID" LENGTH=20  DIVISIONS=10>
			<TRANSLATE x =0.0 y=-2 z =0  />
		</geometry>
	</scene>
	
	<scene name="Axis">
		<geometry name = "axis" type = "AXIS"  >
			<SCALE x=5 y=5 z =5 />
		</geometry>
	</scene>
	
</scenes>

The end result could be something like the figures below (where the bottom figure shows the wireframe version).