Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Object Tracks

A movie’s object track is a track that contains information about the object nodes in a scene. The media type of the object track is 'obje'. Each sample in an object track corresponds to a single object node in the scene. The samples of the object track contain information describing the object images stored in the object image track.

These object information samples parallel the corresponding node samples in the QTVR track and are equal in time and duration to a particular object node’s image samples in the object’s image track as well as the object node’s hot spot samples in the object’s hot spot track.

Object tracks do not have a sample description (although QuickTime requires that you specify a dummy sample description when you call AddMediaSample to add a sample to an object track). The sample itself is an atom container that contains a single object sample atom and other optional atoms.

Object Sample Atom Structure

object sample atom describes a single object, including information about the default viewing angles and the view settings. The structure of an object sample atom is defined by the QTVRObjectSampleAtom data type:

typedef struct VRObjectSampleAtom {
    UInt16                              majorVersion;
    UInt16                              minorVersion;
    UInt16                              movieType;
    UInt16                              viewStateCount;
    UInt16                              defaultViewState;
    UInt16                              mouseDownViewState;
    UInt32                              viewDuration;
    UInt32                              columns;
    UInt32                              rows;
    Float32                             mouseMotionScale;
    Float32                             minPan;
    Float32                             maxPan;
    Float32                             defaultPan;
    Float32                             minTilt;
    Float32                             maxTilt;
    Float32                             defaultTilt;
    Float32                             minFieldOfView;
    Float32                             fieldOfView;
    Float32                             defaultFieldOfView;
    Float32                             defaultViewCenterH;
    Float32                             defaultViewCenterV;
    Float32                             viewRate;
    Float32                             frameRate;
    UInt32                              animationSettings;
    UInt32                              controlSettings;
} VRObjectSampleAtom, *VRObjectSampleAtomPtr;
QT
QT
QT
Field descriptions
majorVersion

The major version number of the file format.

minorVersion

The minor version number of the file format.

movieType

The movie controller type.

viewStateCount

The number of view states of the object. A view state selects an alternate set of images for an object’s views. The value of this field must be positive.

defaultViewState

The 1-based index of the default view state. The default view state image for a given view is displayed when the mouse button is not down.

mouseDownViewState

The 1-based index of the mouse-down view state. The mouse-down view state image for a given view is displayed while the user holds the mouse button down and the cursor is over an object movie.

viewDuration

The total movie duration of all image frames contained in an object’s view. In an object that uses a single frame to represent a view, the duration is the image track’s sample duration time.

columns

The number of columns in the object image array (that is, the number of horizontal positions or increments in the range defined by the minimum and maximum pan values). The value of this field must be positive.

rows

The number of rows in the object image array (that is, the number of vertical positions or increments in the range defined by the minimum and maximum tilt values). The value of this field must be positive.

mouseMotionScale

The mouse motion scale factor (that is, the number of degrees that an object is panned or tilted when the cursor is dragged the entire width of the VR movie image). The default value is 180.0.

minPan

The minimum pan angle, in degrees. The value of this field must be less than the value of the maxPan field.

maxPan

The maximum pan angle, in degrees. The value of this field must be greater than the value of the minPan field.

defaultPan

The default pan angle, in degrees. This is the pan angle used when the object is first displayed. The value of this field must be greater than or equal to the value of the minPan field and less than or equal to the value of the maxPan field.

minTilt

The minimum tilt angle, in degrees. The default value is +90.0. The value of this field must be less than the value of the maxTilt field.

maxTilt

The maximum tilt angle, in degrees. The default value is –90.0. The value of this field must be greater than the value of the minTilt field.

defaultTilt

The default tilt angle, in degrees. This is the tilt angle used when the object is first displayed. The value of this field must be greater than or equal to the value of the minTilt field and less than or equal to the value of the maxTilt field.

minFieldOfView

The minimum field of view to which the object can zoom. The valid range for this field is from 1 to the value of the fieldOfView field. The value of this field must be positive.

fieldOfView

The image field of view, in degrees, for the entire object. The value in this field must be greater than or equal to the value of the minFieldOfView field.

defaultFieldOfView

The default field of view for the object. This is the field of view used when the object is first displayed. The value in this field must be greater than or equal to the value of the minFieldOfView field and less than or equal to the value of the fieldOfView field.

defaultViewCenterH

The default horizontal view center.

defaultViewCenterV

The default vertical view center.

viewRate

The view rate (that is, the positive or negative rate at which the view animation in the object plays, if view animation is enabled). The value of this field must be from –100.0 through +100.0, inclusive.

frameRate

The frame rate (that is, the positive or negative rate at which the frame animation in a view plays, if frame animation is enabled). The value of this field must be from –100.0 through +100.0, inclusive.

animationSettings

A set of 32-bit flags that encode information about the animation settings of the object.

controlSettings

A set of 32-bit flags that encode information about the control settings of the object.

The movieType field of the object sample atom structure specifies an object controller type, that is, the user interface to be used to manipulate the object.

QuickTime VR supports the following controller types:

enum ObjectUITypes {
    kGrabberScrollerUI                          = 1,
    kOldJoyStickUI                              = 2,
    kJoystickUI                                 = 3,
    kGrabberUI                                  = 4,
    kAbsoluteUI                                 = 5
};
Constant descriptions
kGrabberScrollerUI

The default controller, which displays a hand for dragging and rotation arrows when the cursor is along the edges of the object window.

kOldJoyStickUI

A joystick controller, which displays a joystick-like interface for spinning the object. With this controller, the direction of panning is reversed from the direction of the grabber.

kJoystickUI

A joystick controller, which displays a joystick-like interface for spinning the object. With this controller, the direction of panning is consistent with the direction of the grabber.

kGrabberUI

A grabber-only interface, which displays a hand for dragging but does not display rotation arrows when the cursor is along the edges of the object window.

kAbsoluteUI

An absolute controller, which displays a finger for pointing. The absolute controller switches views based on a row-and-column grid mapped into the object window.

Animation Settings

The animationSettings field of the object sample atom is a long integer that specifies a set of animation settings for an object node. Animation settings specify characteristics of the movie while it is playing. Use these constants to specify animation settings:

enum QTVRAnimationSettings {
    kQTVRObjectAnimateViewFramesOn              = (1 << 0),
    kQTVRObjectPalindromeViewFramesOn           = (1 << 1),
    kQTVRObjectStartFirstViewFrameOn            = (1 << 2),
    kQTVRObjectAnimateViewsOn                   = (1 << 3),
    kQTVRObjectPalindromeViewsOn                = (1 << 4),
    kQTVRObjectSyncViewToFrameRate              = (1 << 5),
    kQTVRObjectDontLoopViewFramesOn             = (1 << 6),
    kQTVRObjectPlayEveryViewFrameOn             = (1 << 7)
};
Constant descriptions
kQTVRObjectAnimateViewFramesOn

The animation setting to play all frames in the current view state.

kQTVRObjectPalindromeViewFramesOn

The animation setting to play a back-and-forth animation of the frames of the current view state.

kQTVRObjectStartFirstViewFrameOn

The animation setting to play the frame animation starting with the first frame in the view (that is, at the view start time).

kQTVRObjectAnimateViewsOn

The animation setting to play all views of the current object in the default row of views.

kQTVRObjectPalindromeViewsOn

The animation setting to play a back-and-forth animation of all views of the current object in the default row of views.

kQTVRObjectSyncViewToFrameRate

The animation setting to synchronize the view animation to the frame animation and use the same options as for frame animation.

kQTVRObjectDontLoopViewFramesOn

The animation setting to stop playing the frame animation in the current view at the end.

kQTVRObjectPlayEveryViewFrameOn

The animation setting to play every view frame regardless of play rate. The play rate is used to adjust the duration in which a frame appears but no frames are skipped so the rate is not exact.

Control Settings

The controlSettings field of the object sample atom is a long integer that specifies a set of control settings for an object node. Control settings specify whether the object can wrap during panning and tilting, as well as other features of the node. The control settings are specified using these bit flags:

enum QTVRControlSettings {
    kQTVRObjectWrapPanOn                        = (1 << 0),
    kQTVRObjectWrapTiltOn                       = (1 << 1),
    kQTVRObjectCanZoomOn                        = (1 << 2),
    kQTVRObjectReverseHControlOn                = (1 << 3),
    kQTVRObjectReverseVControlOn                = (1 << 4),
    kQTVRObjectSwapHVControlOn                  = (1 << 5),
    kQTVRObjectTranslationOn                    = (1 << 6)
};
Constant Descriptions
kQTVRObjectWrapPanOn

The control setting to enable wrapping during panning. When this control setting is enabled, the user can wrap around from the current pan constraint maximum value to the pan constraint minimum value (or vice versa) using the mouse or arrow keys.

kQTVRObjectWrapTiltOn

The control setting to enable wrapping during tilting. When this control setting is enabled, the user can wrap around from the current tilt constraint maximum value to the tilt constraint minimum value (or vice versa) using the mouse or arrow keys.

kQTVRObjectCanZoomOn

The control setting to enable zooming. When this control setting is enabled, the user can change the current field of view using the zoom-in and zoom-out keys on the keyboard (or using the VR controller buttons).

kQTVRObjectReverseHControlOn

The control setting to reverse the direction of the horizontal control.

kQTVRObjectReverseVControlOn

The control setting to reverse the direction of the vertical control.

kQTVRObjectSwapHVControlOn

The control setting to exchange the horizontal and vertical controls.

kQTVRObjectTranslationOn

The control setting to enable translation. When this setting is enabled, the user can translate using the mouse when either the translate key is held down or the controller translation mode button is toggled on.



< Previous PageNext Page > Hide TOC


Last updated: 2007-09-04




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice