Titania X3D Editor

Bring Colours to Your Life.

Titania v4.3.0

Bring Colours to Your Life.

X3D Reference

Introducing script use

Motivation

Many actions are too complex for animation nodes:

  • Computed animation paths (eg. gravity)
  • Algorithmic shapes (eg. fractals)
  • Collaborative environments (eg. games)

You can create new sensors, interpolators, etc., using program scripts written in:

  • JavaScript - easy-to-learn language
  • ECMAScript - same as JavaScript

Syntax: Script

A Script node selects a program script to run:

  • url - choice of program script

Defining the program script interface

A Script node also declares the program script interface:

  • initializeOnly, inputOnly, outputOnly, inputOutput - inputs and outputs
    • Each has a name and data type
    • Fields have an initial value

A sample using a program script

Summary

The Script node selects a program script, specified by a URL.

Program scripts have field and event interface declarations, each with:

  • A data type
  • A name
  • An initial value (fields only)