Primitive-Based Modeling System


Basic System

#include "lang.h"
#include "prim.h"
#include "sphere.h"
#include "hier.h"


main(int argc, char **argv)
{
  lang_define("hier", hier_parse);
  lang_define("group", group_parse);
  lang_define("transform", xform_parse);
  lang_define("sphere", sphere_parse);

  if (lang_parse() == 0)
    lang_eval();
  exit(0);
}


Input-Output

hier {
	transform { translate = { .5, .5, 0}},
	group {
		transform { zrotate = .4 },
		obj = sphere{ },
		transform { translate = {.2, 0, 1}},
		group {
			transform{ scale = {2, 0.4, 1}},
			obj = sphere{ radius = .1} }
	}
};


Extension Options

  1. Include visualization as 3 orthogonal views (XYZ) and an auxiliary view.

  2. Include different edit commands, such as: create, delete, rename, undo, select, etc.

  3. Include the Primitives: Box, Cone, Cylinder, Torus and Superquadrics. The primitive instances should be identified by symbolic names and have an arbitrary transformation associated with it. The user should be able to change the all parameters of an object after it is created.

  4. Include groups. Groups are identified by a name. The group hierarchy should be displayed as a graph in the auxiliary view.

Alternative Option

  1. Options 1-2 above

  2. Include the Primitive: Cylinder.

  3. Include Joints and support to construct articulated figures.


Copyright © 1999 Luiz Velho