<<<<<<<<<<<<<<<<<

k_hierarchy(gert) Gert k_hierarchy(gert)

NAME

k_hierarchy

DESCRIPTION

K_Hierarchy is a geometry object. It is used for speed up ray-object intersection. Each instance of k_hierarchy has associated list of children and a bounding_volume object of special kind (see multislab). When ray-k_hierarchy intersection is searched, (1) ray is intersected with object's bounding_volume, (2) in there is an intersection, the ray is intersected with bounding_volumes of children, etc. (see details of implementation in B. Yamrom "Ray Tracing: An Object-Oriented Design", General Electric TIE Report 88CRD059, Schenectady, NY, 1988).

SUPERCLASS

geometry

INSTANCE VARIABLES

bounding_volume is the pointer to associated multislab.

children is the list of pointers to children k_hierarchies.

childrens_number is the number of children.

closest_object is the pointer to the closest object in k_hierarchy relative to ray.

primitive is the pointer to primitive geometry (sphere, block, cone, ...) if an instance is a leaf node in k_hierarchy tree.

MESSAGES

bounding_volume=argument sets the value of the bounding_volume instance variable to the argument that can be either object name or object pointer.

bounding_volume? returns bounding_volume instance variable.

children=argument sets the value of the children instance variable to the argument that can be either a list of object names or a list of object pointers. Sets also the children_number instance variable.

children? returns the list of childrens.

estimate! finds intersection ray-bounding_volume of the k_hierarchy by forwarding the message to the instance's bounding_volume object.

estimation? forwards the message to instance's bounding_volume.

intersect! finds the parameter of ray-object intersection and the closest object in k_hierarchy.

near_far! calculates near_far for bounding_volumes in hierarchy.

near_far? returns near_far of an instance.

primitive=argument sets the primitive of an instance.

primitive? returns the primitive of an instance.

transform_bounding_volume! this method exists for compatibility with other geometry primitives. It does nothing.

row_product! forwards the message to the primitive of an instance if it is a leaf node, otherwise forwards it to the children.

EXAMPLE

k_hierarchy_1 := k_hierarchy{ scale= (35,39,45) position=(0,0,15) properties=blue };

SEE ALSO

kh_generator, multislab, ray, geometry, block, cone, cone, sphere, properties


Please send comments and suggestions to
consult@rpi.edu