Class dnx.lr.node.MovieTextureNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.MovieTextureNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.SubsidiaryNode
                           |
                           +----dnx.lr.TextureNode
                                   |
                                   +----dnx.lr.node.MovieTextureNode

public class MovieTextureNode
extends TextureNode
 MovieTexture {
    exposedField SFBool       loop            FALSE
    exposedField SFFloat      speed           1
    exposedField SFTime       startTime       0
    exposedField SFTime       stopTime        0
    exposedField MFString     url             []
    field        SFBool       repeatS         TRUE
    field        SFBool       repeatT         TRUE
    eventOut     SFFloat      duration_changed 
    eventOut     SFBool       isActive        
 }

The MovieTexture node defines a time dependent texture map (contained in a movie file) and parameters for controlling the movie and the texture mapping. A MovieTexture can also be used as the source of sound data for a Sound node, but in this special case are not used for rendering.

Texture maps are defined in a 2D coordinate system, (s, t), that ranges from 0.0 to 1.0 in both directions. The bottom edge of the image corresponds to the S-axis of the texture map, and left edge of the image corresponds to the T-axis of the texture map. The lower-left pixel of the image corresponds to s=0, t=0, and the top-right pixel of the image corresponds to s=1, t=1.

The url field that defines the movie data must support MPEG1-Systems (audio and video) or MPEG1-Video (video-only) movie file formats [MPEG]. See "Concepts - URLS and URNs" for details on the url field. It is recommended that implementations support greyscale or alpha transparency rendering if the specific movie format being used supports these features.

See "Concepts - Lighting Model" for details on lighting equations and the interaction between textures, materials, and geometries.

As soon as the movie is loaded, a duration_changed eventOut is sent. This indicates the duration of the movie, in seconds. This eventOut value can be read (for instance, by a Script) to determine the duration of a movie. A value of -1 implies the movie has not yet loaded or the value is unavailable for some reason.

The loop, startTime, and stopTime exposedFields and the isActive eventOut, and their affects on the MovieTexture node, are discussed in detail in the "Concepts - Time Dependent Nodes" section. The "cycle" of a MovieTexture is the length of time in seconds for one playing of the movie at the specified speed.

If a MovieTexture is inactive when the movie is first loaded, then frame 0 is shown in the texture if speed is non-negative, or the last frame of the movie if speed is negative. A MovieTexture will always display frame 0 if speed = 0. For positive values of speed, the frame an active MovieTexture will display at time now corresponds to the frame at movie time (i.e., in the movie's local time system with frame 0 at time 0, at speed = 1):

         fmod (now - startTime, duration/speed)
 

If speed is negative, then the frame to display is the frame at movie time:

         duration + fmod(now - startTime, duration/speed).
 

When a MovieTexture becomes inactive, the frame corresponding to the time at which the MovieTexture became inactive will remain as the texture.

The speed exposedField indicates how fast the movie should be played. A speed of 2 indicates the movie plays twice as fast. Note that the duration_changed output is not affected by the speed exposedField. set_speed events are ignored while the movie is playing. A negative speed implies that the movie will play backwards. However, content creators should note that this may not work for streaming movies or very large movie files.

MovieTextures can be referenced by an Appearance node's texture field (as a movie texture) and by a Sound node's source field (as an audio source only). A legal implementation of the MovieTexture node is not required to play audio if speed is not equal to 1.


Variable Index

 o duration_changed
 o isActive
 o loop
 o repeatS
 o repeatT
 o speed
 o startTime
 o stopTime
 o url

Constructor Index

 o MovieTextureNode()

Method Index

 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getTexture(Graphics3DDevice)
 o initFields()
Initialize field values.

Variables

 o loop
  public SFBool loop
 o speed
  public SFFloat speed
 o startTime
  public SFTime startTime
 o stopTime
  public SFTime stopTime
 o url
  public MFString url
 o repeatS
  public SFBool repeatS
 o repeatT
  public SFBool repeatT
 o duration_changed
  public SFFloat duration_changed
 o isActive
  public SFBool isActive

Constructors

 o MovieTextureNode
  public MovieTextureNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o getTexture
  public Texture getTexture(Graphics3DDevice device)
Overrides:
getTexture in class TextureNode

All Packages  Class Hierarchy  This Package  Previous  Next  Index