| java.lang.Object com.sun.j3d.loaders.lw3d.SequenceLine
SequenceLine | class SequenceLine (Code) | | This class was created to handle "sequence files", which allow
holosketch-type Tloop sequences to be loaded through the lw3d loader.
The class reads a sequence file line by line and uses SequenceLine to
load the file specified in each line.
Idea behind the Tloop process:
Artist creates "tloops" (animations with each keyframe's
geometry saved out explicitly) where the geometries are spaced
one frame apart. Then I can automatically create a SwitchValueInterpolator
based on this spacing. If the number of frames in the sequence is
greater than the number of frames in the tloop, then it will automatically
loop until the end of the sequence.
Process:
1) Artist creates an animation of a null group that has a child with some
special name, such as "bucket_sequence_bucketsequence.txt.lwo", which tells
the lw3d loader that it should look for a sequence file by the name of
bucketsequence.txt. What happens to this object is irrelevant (as far as
the loader is concerned); all animation information is taken from its
parent instead.
2) Artist saves out the geometry of the bucket at whatever frames she wants
to. If she's saving a tloop (a sequence of frames), she should save them
under the names xxx.lwo, where xxx is the 3-digit sequence number
(000, 001, 002, etc.).
3) Artist creates the sequence file, which lists all saved geometry files
(except sequences - these can be referred to simply by the first file
(...000.lwo)), along with their associated start/end frames. She also lists
the number of files in the sequence, although this parameter is implied
anyway, through the existence of the sequence files and their naming
convention. Maybe we should trash this guy.
4) In the lw3d loader, when LwsObject encounters an object with the
filename "..._sequence_.lwo", it searches for filename. If
found, it parses the file (using the SequenceReader class) to retrieve
all parameters.
5) Each SequenceLine creates a Java3D group containing its objects. This
is either a plain-old-Group (if there is only one object) or a Switch group
with a SwitchValueInterpolator.
6) SequenceReader constructs a Switch group and adds all SequenceLine groups
to this new group. It also creates a SwitchPathInterpolator (child of
PathInterolator) that contsructs an Alpha based on the startFrame values of
each SequenceLine. It creates a group and adds the SwitchPathInterpolator
plus any SequenceLine SwitchValueInterpolators to this group.
7) LwsObject adds the SequenceReader Switch group to its objectTransform.
It does a getBehaviors() from SequenceReader and adds the result (the
SwitchPathInterpolator group) to its objectBehaviors group.
8) Done.
|
startFrame | int startFrame(Code) | | |
totalFrames | int totalFrames(Code) | | |
totalTime | float totalTime(Code) | | |
createJava3dObjects | void createJava3dObjects(int debugVals, int loadBehaviors) throws IncorrectFormatException, FileNotFoundException(Code) | | Create Java3d objects from the data in the sequence line. This
means that for a tloop file (ends in "000"), we're going to create
the appropriate geometry for each file, put them all in a Switch
node, then create a SwitchValueInterpolator to swap between the
frames of the tloop. If it's not a tloop, then we're just going to
create the geometry for that file.
|
|
|