NAME
define_world - define world coord frame
PROTOTYPE
unitptr define_world(unitptr host)
ARGUMENTS
- unitptr host
- host unit
RETURN VALUE:
- unitptr u:
- pointer to newly created unit
INTERFACE OF CREATED UNIT:
This unit has no pins.
DESCRIPTION:
This unit, in conjunction with the units world_to_obj and
obj_to_world, is provided to allow easy coordinate transformations
between the coordinate frame that is currently used
for drawing ("object frame"), and a second coordinate frame
that was used for drawing some time before. This second
coordinate frame must have been marked as "world frame" by
the creation of a define_world- unit or an exec-call to an
existing instance of the define_world- unit at the time when
this coordinate frame was the valid drawing frame. It will
then serve as a fixed reference frame to and from which
transformations are made by the two units world_to_obj and
obj_to_world, until a new exec-call for a define_world
replaces it by the drawing frame that is valid at the time
of the new call.
The routines define_world, world_to_obj and obj_to_world use
the matrix on top of the GL matrix stack in order to compute
their transformations.
Currently, there is no use to have more than one instance of
the define_world-unit.
SEE ALSO:
world_to_obj, obj_to_world
EXAMPLES:
Calling the define_unit routine before drawing a robot will
define the base coordinate system in which the robot is
defined as the new world frame. If then at some later time a
joint of the robot is drawn, and if the joint is centered at
the origin of its local drawing coordinate frame, an exec-
call of an obj_to_world-unit with input vector (0,0,0) will
return the position vector of the joint in the world frame
in which the robot is defined.
FILE
/local/homes/rhaschke/nst7/man/../o.linx86_64//../foldersrc/nst_solid.c