logo

Animated Geometries in JavaView

Animated set of points based on three files. Use ctrl-a or F4 to open the animation dialog and stop the animation.
The simplest kind of animations in JavaView are so-called keyframe animations. A keyframe animation consists of a sequence of geometries (each is called a keyframe) which are usually of the same kind, like a surface. JavaView can either show each of the geometries one after another, or, more intelligently, provide smooth transitions between successive geometries. Smooth transitions are available if all keyframes of a geometry have the same underlying combinatorial mesh.

The playback of animations can be controlled by several applet respectively command line parameters. This includes the speed of the animation, the display of an animation control panel, or the automatic start of an animation.

Applet parameters must be included within the applet tag in an Html page like

<applet ....
    <param name=model value="models/animation/flow.*.jvx">
    <param name=Animation.lastKey value=3>
</applet>

The parameters a valid both as applet parameters and as command line arguments. Command line arguments are supplied like on MS-Windows with javaview.exe available:

javaview "model=models/animation/flow.*.jvx" Animation.lastKey=3

or when using the JDK

java javaview "model=models/animation/flow.*.jvx" Animation.lastKey=3

Note: commandline arguments such as "key=value" must be enclosed with quotes in case that the shell of the operating system interprets characters such as * or blanks.

Animation

A set of geometry files may be animated in JavaView. For example, the set of files {flow.1.jvx, flow.2.jvx, flow.3.jvx} contains three frames of an animated geometry where the i-th file contains the full geometry shown at time i. JavaView will then playback a smooth animation by (e.g. linear) interpolation between the three keyframe geometries.

The length of the time line in JavaView is 100 where the first keyframe is at time=0 and the last keyframe at time=100. All other keyframes are equally distributed over the time line. During an animation JavaView sucessively computes a section at time t by interpolation between those two keyframes whose keyframe times t_i and t_i+1 bracket the current time t_i <= t < t_i+1.

JavaView tries to play 20 frames per second as theoretical default speed, i.e. it assumes that rendering is done at no time cost. The variable framesPerSecond determines the maximum number of updates of the display during an animation. Since rendering takes some time and depends on the computer and the size of a scene, especially in Java, the number of frames per second should not exceed 30. To get a feeling of a faster animation one is might use the variable timeStepIncr in addition if a larger number of framesPerSecond is not realizable on a specific computer.

The variable timeStepIncr h determines the increment on the time line between two successive sections, that means, after showing a section at time t the next section is shown at time t+h. Note, the variable timeStepIncr influences the subjective feeling of speed at the cost of temporal resolution.

Applet parameters for animations were revised and extended in JavaView v. 2.49.

Name Value Comment
model "models/animation/flow.*.jvx" Load a set of geometries from the given files in any of the supported file formats. The path must be relative to the codebase of the applet. The '*' will be replaced by JavaView with consecutive integer numbers in the interval [firstKey,lastKey].
Animation.firstKey 1 Index of first key, i.e. animation will start with file geom.[firstKey].jvx. Default is 1.
Animation.lastKey 3 Index of last key, i.e. animation will start with file geom.[lastKey].jvx. Default is 1.
Animation.fixedLen 4 Optional parameter determines the number of digits of the number field used in the numbering of the keyframe files. For example, flow.0023.jvx has fixedLen=4. Default value is 0, meaning no-fixed length.
Animation.dialog [Show] | Hide Show or hide the animation dialog, default is Show.
Animation.speedType [Forward] | Rewind |
FastForward | FastRewind
Winding direction and speed of the animation, default is Forward.
Animation.repeatType [BackForth] | Loop | OneWay Repeat behavior of the animation when either end of the timeline is reached, default is BackForth.
Animation.framesPerSecond 20 Show or hide the animation dialog, default is 20.
Animation.timeStepIncr 1 Increment between two successive sections, default is 1.
Animation.timePageIncr 5 Page increment on the animation slider, default is 5.
Animation.start Show | [Hide] Start the animation immediately, default is Hide.

If the parameter firstKey or lastKey is omitted, then its default value is used: firstKey=1, lastKey=1.

All files of an animation must exist, that is, {geom.[firstKey].jvx, geom.[firstKey+1].jvx, ..., geom.[lastKey].jvx}.

Examples

1. Command line launches an animation using a javaview shell script or windows executable. Alternatively use "java javaview ...".

prompt> javaview Animation.firstKey=1 Animation.lastKey=3 "models/animation/flow.*.jvx"
prompt> javaview Animation.start=show Animation.dialog=hide
        Animation.firstKey=1 Animation.lastKey=3 "models/animation/flow.*.jvx"

2. Applet tag which launches an animation:

<applet
    code="javaview.class" width=200 height=200
    archive="jars/javaview.jar" codebase="../">
    <param name=model value="models/animation/flow.*.jvx">
    <param name=Animation.start value=show>
    <param name=Animation.dialog value=hide>
    <param name=Animation.firstKey value=1>
    <param name=Animation.lastKey value=3>
</applet>
© 1996-2013 Last modified: 07.05.2013 --- www.javaview.de --- The JavaView Project