Class SoMPEGNavRenderer


  • public class SoMPEGNavRenderer
    extends SoMPEGRenderer
    Generates MPEG output that tracks camera motion. This class generates MPEG output that tracks (i.e. follows) camera motion specifically changes in the position, orientation, nearDistance, and farDistance fields. These are the fields that can be modified by mouse movements within a viewer.

    After SoMPEGNavRenderer.record() is called, all camera movements are recorded until SoMPEGNavRenderer.stop() is called. At that time, frames corresponding to each camera movement are rendered and stored in the MPEG output.

    See the parent class SoMPEGRenderer for methods to specify the file and recording parameters.

    See Also:
    SoMPEGRenderer, SoMPEGFrameRenderer
    • Constructor Detail

      • SoMPEGNavRenderer

        public SoMPEGNavRenderer​(SoNode node)
        Constructor. The method SoMPEGRenderer.setSceneGraph() is called with the given argument. The specified scene graph must contain a camera in order to produce correct results.
    • Method Detail

      • adjustNumFramesPerSecond

        public void adjustNumFramesPerSecond​(boolean flag)
        Specifies whether the camera movements are adjusted to the number of frames per second. Default is false.

        • false: Indicates that each camera movement corresponds to one frame in the MPEG output. The amount of time between two camera movements is not taken into consideration.
        • true: The renderer takes into account the amount of time between two camera movements for generating frames. A new camera position could be associated with 0, 1, or several frames in the MPEG output depending on how long the camera stayed in that position during the recording period. When the MPEG is played, the camera movements will replay at the same speed as when they were originally recorded.
      • isAdjustedNumFramesPerSecond

        public boolean isAdjustedNumFramesPerSecond()
        Returns whether the camera movements are adjusted to the number of frames per second.
      • getCamera

        public SoCamera getCamera()
        Returns the camera currently used by the MPEG renderer.
      • setCamera

        public void setCamera​(SoCamera camera)
        Specifies the camera to be used by the MPEG renderer. Setting the camera is only needed if the first camera found in the scene isn't the one that should be used.