Group Nodes
group
SLIDE Definition |
tclinit Definition |
|
|
SLIDE Defaults |
tclinit Defaults |
|
slide create group id \
|
|
-surface $SLF_INHERIT \
-shading $SLF_INHERIT \
-lod $SLF_FULL \
-ribbegin $SLF_NULL \
-ribend $SLF_NULL
|
|
Objects whose component vertices are
initially defined in local coordinate systems are appropriately placed
and oriented in the World Coordinate System by the application of
geometric transformations. A modular
way of constructing a complicated scene is to build up a hierarchy by
creating multiple instances of primitive
objects and appropriately altering the geometric and appearance
attributes of each of these instances. Geometric attributes are
altered by the application of geometric transformations. Cameras and lights
can also be similarly instanced and transformed.
In SLIDE, hierarchy is built up in a recursive manner
using groups which are equivalent to compound objects.
Groups are collections of instances of primitive
objects as well as other groups, lights, and cameras.
Groups and objects share the same local identifier name space.
The group statement is used to define the scene hierarchy.
An instance_statement can be a
geometry,
camera,
or a
light instance.
The three different types of instance statements may only occur
within a group statement.
Each instance includes transformations that place the referenced
entity with the coordinate space of the current group.
The transformations within an instance statement are applied
one at a time in the order specified.
See the SLIDE Flags section for a complete
description of the
shading_flag and the
lod_flag
and the Surface Specification section for a
description of how to use the surface_id.
arealight
SLIDE Definition |
tclinit Definition |
|
|
SLIDE Defaults |
tclinit Defaults |
arealight id
|
|
color ( 1.0 1.0 1.0 )
samples 30
surface SLF_INHERIT
shading SLF_INHERIT
lod SLF_FULL
ribbegin SLF_NULL
ribend SLF_NULL
instance_statement
instance_statement
...
|
endarealight |
|
slide create arealight id \
|
|
-color { 1.0 1.0 1.0 } \
-samples 30 \
-surface $SLF_INHERIT \
-shading $SLF_INHERIT \
-lod $SLF_FULL \
-ribbegin $SLF_NULL \
-ribend $SLF_NULL
|
|
The arealight is a hack stand-in for a real area light
provided by more advanced photorealistic renderers, like RenderMan.
The arealight is just like a group node; it
instances some set of geometry nodes. The difference is that the
polygons instanced below an arealight are rendered with
emissive shading (they are bright even if they are not lit by other
lights) and a representative spot light is rendered at the center of
mass of the polygons.
The true use of an arealight is to export the geometry
description to a .RIB file and then render with a higher quality
renderer. The arealight will correctly translate the geometry
to .RIB format.
Field |
Description |
color |
The color of the light emitted by the polygons
|
samples |
The number of samples that should be used by the higher
quality renderer when approximating the area source as a bunch of
point lights
|
instance
SLIDE Definition |
tclinit Definition |
|
|
SLIDE Defaults |
tclinit Defaults |
instance node_id
|
|
id SLF_NULL
surface SLF_INHERIT
shading SLF_INHERIT
lod SLF_FULL
ribbegin SLF_NULL
ribend SLF_NULL
|
endinstance |
|
slide create instance
instance_id group_id node_id \
|
|
-surface $SLF_INHERIT \
-shading $SLF_INHERIT \
-lod $SLF_FULL \
-ribbegin $SLF_NULL \
-ribend $SLF_NULL
|
|
The instance statement is used to create an instance of
geometry; either a
primitive object or another
group specified by
node_id.
The id statement gives the instance a name that can
be used to define path names (explained later).
Any instance that refers to a group that contains
camera or
light instances should have an identifier.
See the SLIDE Flags section for a complete
description of the
shading_flag and the
lod_flag
and the Surface Specification section for a
description of how to use the surface_id.
Each transform_statement defines a linear
transformation to be performed on the
points that comprise the object or group.
These transforms should be applied in the order that they are specified.
For example,
instance fish
id red_fish
surface shiny_red
shading SLF_PHONG
rotate (0 1 0) (7)
translate (100 0 0)
rotate (0 0 1) (38)
endinstance
defines an instance of the group or object, named
fish
.
Any
faces
in fish
that have no defined material property
will use the
surface
shiny_red
.
Any faces in fish
that have no defined shading model
will use the Phong shading model.
The instance, red_fish
will be
rotated by 7o about its own y-axis,
translated from the origin by 100 units along the x-axis,
and then rotated by 38o about the world z-axis,
As another example,
group tetra_stack
surface green
instance tetra
scale (2 2 2)
rotate (0 0 1) (30)
surface red
endinstance
instance tetra
scale (2 2 2)
translate (0 0 2)
rotate (0 0 1) (-30)
endinstance
endgroup
shows the instance statement in context.
This group defines two tetrahedrons scaled up by a factor of 2,
rotated and stacked along the z-axis.
The first tetrahedron will be colored red, because the initial
description of the tetra
object did
not define any surface properties.
The second tetrahedron will be colored green because the
instance will inherit surface information from its enclosing
group.
The default values for an instance statement are:
instance | node_id
surface SLF_INHERIT
shading SLF_INHERIT
lod SLF_FULL
|
endinstance |
The TCLinit block generation syntax looks like this:
(note: groupid refers to the group that the instance will be inserted
into, and the node_id is the object or group that is being instanced)
slide instance groupid node_id
[-surface
surfid] [-shading shading_flag] [-lod
lod_flag] [-xforms {xform_list}
where "xform_list" is of the form:
{
{translate x y z} |
{scale x y z} |
{rotate x y z angle} |
{lookat -eye {x y z} -target {x y z}
-up {x y z} }. . .
}
There can be multiple transforms of each type listed and transforms are
performed in the order placed in the xform_list.
ie: slide instance gThings oThing1 -surface
surfland
-xforms {{scale 0.5 0.5 1}
{rotate 0 0 1 45 }
{translate 0.5 0.3 0.2} }
Note that transformations for TCL generated objects is dealt with
inside "slide instance" commands.
scale
SLIDE Definition |
tclinit Definition |
|
|
The scale_triple specifies the scaling factors applied in
the directions of the three coordinate axes,
s = (sx, sy, sz).
The operation performed on a point,
p = (px, py, pz), is
p' = (px*sx, py*sy, pz*sz),
For example
scale (1 2 1)
defines a scale by 2, stretching the object in the y-direction.
translate
SLIDE Definition |
tclinit Definition |
translate ( translate_triple )
|
|
{ translate translate_triple }
|
|
The translate_triple defines the three components of a translation
vector,
t = (tx, ty, tz).
The operation performed on a point,
p = (px, py, pz), is
p' = (px+tx, py+ty, pz+tz),
For example
translate (10 0 0)
defines a translation by 10 units along the x-axis.
rotate
SLIDE Definition |
tclinit Definition |
rotate ( axis_triple ) ( angle_float )
|
|
{ rotate axis_triple angle_float }
|
|
The axis_triple defines the axis of rotation through the origin,
v = (vx, vy, vz).
The angle of rotation is given in degrees by the angle_float,
a.
For example
rotate (0 0 1) (30)
defines rotation by 30o around the z-axis.
lookat
SLIDE Definition |
tclinit Definition |
lookat |
eye ( eye_triple )
target ( target_triple )
up ( up_triple )
|
endlookat |
|
lookat |
-eye { eye_triple } \
-target { target_triple } \
-up { up_triple } \
|
|
SLIDE Definition |
tclinit Definition |
lookat |
eye ( 0.0 0.0 0.0 )
target ( 0.0 0.0 -1.0 )
up ( 0.0 1.0 0.0 )
|
endlookat |
|
lookat |
-eye { 0.0 0.0 0.0 } \
-target { 0.0 0.0 -1.0 } \
-up { 0.0 1.0 0.0 } \
|
|
The lookat transformation defines a rigid body
transformation that is specifically designed for
orienting a camera
to view a scene, although it can be used wherever a
transform_statement can appear.
The eye_triple and the target_triple define eye
and target as points in 3D.
The up_triple defines up as a vector in 3D.
The effect of the lookat transform is to:
- translate the Object Coordinate System so that the origin of
the object lies at the point, eye,
- and rotate the object so that the point, target, lies on the
-z-axis of the object's system and the up vector lies in the
yz-plane of the object's system.
For example,
lookat
eye (10 0 0)
target (0 0 0)
up (0 0 1)
endlookat
defines a transformation that places a
camera
10 units from the origin
along the x-axis, pointing at the origin, with the
z-axis pointing up.
Or, this transform places an
object
with its origin at
(10 0 0)
,
its z-axis aligned with the world's x-axis,
and its y-axis aligned with the world's z-axis.
The default values for a lookat statement define the identity
transformation. They are
lookat |
eye (0 0 0)
target (0 0 -1)
up (0 1 0)
|
endlookat |
[an error occurred while processing this directive]