The Animate Command


Usage

Note: [ ] denotes optional arguments.

Description

The animate command assigns an animation to the object. It is by far the most complex and probably least understood action command. For this reason, the following help pages have been added to address specific uses of the animate command:

The optional tag argument specifies the tag number of the polygon on the object to which the animation is applied. If omitted, the animation is applied to every polygon on the object.

If mask is specified, the animation is masked, and Active Worlds will attempt to download and apply a corresponding mask file for each texture in the animation sequence. The nomask option explicitly specifies that textures applied by the animation are not to be masked. By default, animations are not masked.

Important note: The behavior of the animate command has changed beginning with Active Worlds 3.0! By default, animations are now not masked. If you have an animation that uses mask files to apply transparency to parts of the textures involved, you must now explicitly specify the mask option or all textures in the animation will be applied unmasked.

The object-name argument specifies the name of the object to apply the animation to. This argument must be specified. If the animation is to be applied to this object, specify the keyword me as the object name.

Object names are assigned via the name command. The Animate command always requires the use of an object name, and will therefore recognize the name me as meaning the object on which the command is found.

The animation-name argument specifies the base name of the textures to be used in the animation.

The imagecount argument specifies the total number of unique textures in the animation.

The framecount argument specifies the total number of frames in the animation sequence. Note this does not have to be the same as imagecount since a given image can be used more than once in an animation sequence.

The framedelay argument specifies the time in milliseconds between each frame of the animation. Note that low numbers for the framedelay may cause the animation to drop frames in order to keep up on slower systems. A framedelay of 0 means animate at the same rate as the browser's current frame rate.

The optional framelist argument allows you to specify the order of images to be displayed in the animation. This argument must be specified if imagecount and framecount are different. The default frame list is 1 through imagecount.

Historically the animate command has been used most often for the purpose of placing a single static texture on an object. Please consider using the more efficient texture command for this purpose.

Note that the animate and texture commands will not display textures predictably on objects which do not have UV texture values specified for the vertices of the object.

Example

This action triggers a 9-frame animation called "jump" when the object is clicked on. The animation runs at 10 frames per second (100 milliseconds between frames). Note that while there are 9 frames in the animation, there are only 5 images since the first four are reused again on the way back down. The texture files for this animation will be named jump1.jpg, jump2.jpg, up to jump5.jpg, and the mask files will be jump1m.zip, jump2m.zip, up through jump5m.zip.

In this example, note the use of the create trigger combined with the astop command in order to set up the animation and stop it at the first frame. The activate trigger combined with the astart command tells the animation to start running when the object is clicked on.