Texture and sound node. More...
#include <Inventor/VRMLnodes/SoVRMLMovieTexture.h>
Public Types | |
enum | Model { MODULATE = GL_MODULATE, DECAL = GL_DECAL, BLEND = GL_BLEND, REPLACE = GL_REPLACE } |
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVRMLMovieTexture () | |
void | setVideoCaptureFormat (int32_t width, int32_t height, int32_t framePerSec) |
void | allowPrequalifyFile (SbBool) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static void | setPrequalifyFileCallBack (VRMLMoviePrequalifyFileCallback *, void *) |
Public Attributes | |
SoSFBool | loop |
SoSFFloat | speed |
SoSFTime | startTime |
SoSFTime | stopTime |
SoSFTime | pauseTime |
SoSFTime | resumeTime |
SoMFFilePathString | url |
SoSFFloat | alpha |
SoSFEnum | model |
SoSFColor | blendColor |
SoSFBool | scaleTexCoord |
SoSFTime | duration_changed |
SoSFBool | isActive |
SoSFBool | isPaused |
SoSFTime | elapsedTime |
The SoVRMLMovieTexture node defines a time-dependent texture map (contained in a movie file) and parameters for controlling the movie and the texture mapping.
NOTE: This class does not exist in Open Inventor 10.0 and later.This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org.
The SoVRMLMovieTexture node defines a time dependent texture map (contained in a movie file) and parameters for controlling the movie and the texture mapping. An SoVRMLMovieTexture can also be used as the source of sound data for an SoVRMLSound node, but in this special case is 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. See "Concepts - URLS and URNs" for details on the url field. It is recommended that implementations support grayscale 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 SoVRMLMovieTexture node, are discussed in detail in the "Concepts - Time Dependent Nodes" section. The "cycle" of an SoVRMLMovieTexture is the length of time in seconds for one playing of the movie at the specified speed.
If an SoVRMLMovieTexture is inactive when the movie is first loaded, then frame 0 is shown in the texture if speed is nonnegative, or the last frame of the movie if speed is negative. A SoVRMLMovieTexture will always display frame 0 if speed = 0. For positive values of speed, the frame an active SoVRMLMovieTexture 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 an SoVRMLMovieTexture becomes inactive, the frame corresponding to the time at which the SoVRMLMovieTexture 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.
SoVRMLMovieTexture can be referenced by an SoVRMLAppearance node's texture field (as a movie texture) and by an SoVRMLSound node's source field (as an audio source only). A legal implementation of the SoVRMLMovieTexture node is not required to play audio if speed is not equal to 1.
loop | FALSE |
speed | 1 |
startTime | 0 |
stopTime | 0 |
pauseTime | 0 |
resumeTime | 0 |
url | [] |
repeatS | TRUE |
repeatT | TRUE |
alpha | 1.0 |
model | MODULATE |
blendColor | 0 0 0 |
scaleTexCoord | TRUE |
metadata | NULL |
SoSFBool | set_loop |
SoSFFloat | set_speed |
SoSFTime | set_startTime |
SoSFTime | set_stopTime |
SoSFTime | set_pauseTime (Note: Not implemented) |
SoSFTime | set_resumeTime (Note: Not implemented) |
SoMFFilePathString | set_url |
SoSFNode | set_metadata |
SoSFTime | duration_changed |
SoSFTime | elapsedTime (Note: Not implemented) |
SoSFBool | isPaused (Note: Not implemented) |
SoSFBool | isActive |
SoSFBool | loop_changed |
SoSFFloat | speed_changed |
SoSFTime | startTime_changed |
SoSFTime | stopTime_changed |
SoSFTime | pauseTime_changed (Note: Not implemented) |
SoSFTime | resumeTime_changed (Note: Not implemented) |
SoMFFilePathString | url_changed |
SoSFNode | metadata_changed |
Model.
SoVRMLMovieTexture::SoVRMLMovieTexture | ( | ) |
Constructor.
void SoVRMLMovieTexture::allowPrequalifyFile | ( | SbBool | ) |
Sets the prequalify file flag.
If FALSE, the prequalification callback will not be called. Default is TRUE.
static SoType SoVRMLMovieTexture::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoVRMLTexture.
virtual SoType SoVRMLMovieTexture::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLTexture.
static void SoVRMLMovieTexture::setPrequalifyFileCallBack | ( | VRMLMoviePrequalifyFileCallback * | , | |
void * | ||||
) | [static] |
Specifies the application callback that will be invoked when the MovieTexture node is about to read an image file (if the prequalify flag is TRUE).
void SoVRMLMovieTexture::setVideoCaptureFormat | ( | int32_t | width, | |
int32_t | height, | |||
int32_t | framePerSec | |||
) |
[Windows only] In case of video capture from a video input device (see url), this method allows you to configure the video capture settings (the video size format and the video capture rate expressed in frames per second).
If no format is specified, the size and frame rate will be the last used by the capture device. Because video size formats are device specific, the requested size may not be available and a default size will be used instead.
Alpha value used with the video.
If the value is less than 1, the movie texture will be an RGBA image. This uses some additional memory and computation time.
NOTE: field available since Open Inventor 4.0NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
Color used for BLEND model. NOTE: field available since Open Inventor 4.0
NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
Output event.
Output event.
Output event.
Output event.
Controls whether the movie continues when it reaches the end as defined in the movie texture file.
If loop is FALSE , execution is terminated. If TRUE, the movie restarts.
Specifies how to map the texture onto the surface.
Use enum Model. Default is MODULATE.
NOTE: field available since Open Inventor 4.0NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
(Note: Not implemented) The pause time for the sound.
An SoVRMLAudioClip node with loop TRUE at the end of every cycle pauses if current time >= pauseTime >resumeTime
NOTE: field available since Open Inventor 5.0NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
(Note: Not implemented) The resume time for the sound.
An SoVRMLAudioClip node with loop TRUE at the end of every cycle pauses if current time >= resumeTime >pauseTime
NOTE: field available since Open Inventor 5.0NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
Boolean value which controls the way the image is mapped in case of non power-of-two video size.
OpenGL uses only power-of-two textures, so if the texture is not a power of two, it must be rescaled to the next higher power of two, which is time consuming.
NOTE 2: This field is not compatible with VRML97. If you specify a non-default value for this field, when this node is written to a VRML file, the file will contain this incompatible field and standard VRML97 file readers will not be able to read it.
Indicates how fast the movie should be played.
The starting time for the movie.
Specifies the movie data.
AVI files (.avi extension) [Windows only] , MPEG1 and MPEG2 files (.mpg or .mpeg extension) are supported. Specifying a .cam extension (whatever the base file name) [Windows only] allows you to capture video from a video input device such as a camera. In this case, the setVideoCaptureFormat() method allows you to specify the format you want to obtain from your video input device.