このページは機械翻訳を使用して翻訳されました。最新版の英語を参照するには、ここをクリックします。
Aero.VirtualRealityAnimation クラス
名前空間: Aero
仮想現実アニメーションオブジェクトを使用して航空宇宙アニメーションを視覚化する
説明
作成
説明
h = Aero.VirtualRealityAnimation は仮想現実アニメーション オブジェクトを構築します。アニメーション オブジェクトは h に返されます。
プロパティ
アニメーション オブジェクト名。文字ベクトルまたは文字列として指定されます。
属性:
Transient | true |
SetObservable | true |
データ型: char | string
アニメーション オブジェクトに関連付けられた vrworld オブジェクト (配列として指定)。
属性:
Transient | true |
SetObservable | true |
vrworld ファイル名。文字ベクトルまたは文字列として指定されます。
属性:
Transient | true |
SetObservable | true |
データ型: char | string
配列として指定された古い vrworld ファイル名。
属性:
Transient | true |
SetObservable | true |
データ型: char | string
一時的な vrworld ファイル名。文字ベクトルまたは文字列として指定されます。
属性:
Transient | true |
SetObservable | true |
データ型: char | string
アニメーション オブジェクトに関連付けられた vrfigure オブジェクト (配列として指定)。
属性:
Transient | true |
SetObservable | true |
アニメーション オブジェクトに含まれるノードを配列として指定します。
属性:
Transient | true |
SetObservable | true |
アニメーション オブジェクトに含まれる視点。配列として指定されます。
属性:
Transient | true |
SetObservable | true |
スカラー値として指定された現在の時刻(秒単位)。
タイムソースは timeseries または timetable オブジェクトである必要があります。
属性:
Transient | true |
SetObservable | true |
データ型: dobule
保存警告表示設定。0 または 1 として指定します。
属性:
Transient | true |
SetObservable | true |
ビデオ録画を有効にします。次のように指定します:
'off'ビデオ録画を無効にします。
'on'ビデオ録画を有効にします。
'scheduled'ビデオ録画をスケジュールします。このプロパティは、VideoTStart プロパティおよび VideoTFinal プロパティと共に使用します。
属性:
Transient | true |
SetObservable | true |
文字ベクトルまたは文字列として指定されたビデオ録画ファイル名。
属性:
Transient | true |
SetObservable | true |
データ型: char | string
ビデオ録画の圧縮ファイルの種類。次のように指定します:
'Motion JPEG AVI'Motion JPEG コーデックを使用して圧縮された AVI 形式のファイル。
'Archival'ロスレス圧縮の Motion JPEG 2000 形式のファイル。
'Motion JPEG 2000'圧縮されたMotion JPEG 2000形式のファイル。
'MPEG-4'H.264 エンコーディングによる圧縮 MPEG-4 形式ファイル (Windows® 7 システムのみ)。
'Uncompressed AVI'RGB24 ビデオを含む非圧縮 AVI 形式ファイル。
ビデオ圧縮の詳細については、VideoWriter を参照してください。
属性:
Transient | true |
SetObservable | true |
ビデオ録画の品質。0 から 100 までの値として指定されます。
属性:
Transient | true |
SetObservable | true |
データ型: double
スケジュール録画のビデオ録画停止時間。TStart から TFinal までの値として指定されます。
属性:
Transient | true |
SetObservable | true |
データ型: double
スカラーとして指定される時間スケーリング (秒単位)。
属性:
Transient | true |
SetObservable | true |
データ型: double
フレーム レート。スカラー値として指定され、フレーム/秒単位です。
属性:
Transient | true |
SetObservable | true |
データ型: double
録画開始時間(秒単位のスカラー値として指定)。
タイムソースは timeseries または timetable オブジェクトである必要があります。
属性:
Transient | true |
SetObservable | true |
データ型: double
録画停止時間(秒単位のスカラー値として指定)。
タイムソースは timeseries または timetable オブジェクトである必要があります。
属性:
Transient | true |
SetObservable | true |
データ型: double
メソッド
addNode | (To be removed) Add existing node to current virtual reality world |
addRoute | (To be removed) Add VRML ROUTE statement to virtual reality
animation object |
delete | (To be removed) Destroy virtual reality animation object |
initialize | (To be removed) Create and populate virtual reality animation object |
addViewpoint | (To be removed) Add viewpoint for virtual reality animation |
nodeInfo | (To be removed) Create list of nodes associated with virtual reality animation object |
play | (To be removed) Animate virtual reality world for given position and angle in time series data |
removeNode | (To be removed) Remove node from virtual reality animation object |
removeViewpoint | (To be removed) Remove viewpoint node from virtual reality animation |
saveas | 仮想現実アニメーションオブジェクトに関連付けられた仮想現実世界を保存する |
updateNodes | (To be removed) Change virtual reality animation node position and orientation as function of time |
例
この例では、
仮想現実アニメーションオブジェクトのシミュレーションを記録する
飛行データをシミュレートして記録する
アニメーションオブジェクトを作成する
h = Aero.VirtualRealityAnimation; % Control the frame display rate. h.FramesPerSecond = 10; % Configure the animation object to set the seconds of animation data per % second time scaling (TimeScaling) property. h.TimeScaling = 5; % The combination of FramesPerSecond and TimeScaling property determine the % time step of the simulation. These settings result in a time step of % approximately 0.5 s. % This code sets the .wrl file to use in the virtual reality animation. h.VRWorldFilename = 'asttkoff.wrl'; % Load the animation world described in the 'VRWorldFilename' field of the % animation object. initialize(h); % Set simulation timeseries data. takeoffData.mat contains logged simulated % data. takeoffData is set up as a 'StructureWithTime', which is one of the % default data formats. load takeoffData [~, idxPlane] = find(strcmp('Plane', h.nodeInfo)); h.Nodes{idxPlane}.TimeseriesSource = takeoffData; h.Nodes{idxPlane}.TimeseriesSourceType = 'StructureWithTime'; % Use the example custom function vranimCustomTransform to correctly line % up the position and rotation data with the surrounding objects in the % virtual world. This code sets the coordinate transformation function for % the virtual reality animation. h.Nodes{idxPlane}.CoordTransformFcn = @vranimCustomTransform; % Set up recording properties. h.VideoRecord = 'on'; h.VideoQuality = 50; h.VideoCompression = 'Motion JPEG AVI'; h.VideoFilename = 'astMotion_JPEG_VR'; % Play the animation. play(h); % Wait for the animation to stop running before modifying the object. wait(h); % Verify that a file named astMotion_JPEG_VR.avi was created in the current folder. % Disable recording to preserve the file. h.VideoRecord = 'off';

4秒間の飛行データをシミュレートします。
データを使用してアニメーション オブジェクトを作成します。
h = Aero.Animation;
フレームの表示レートを制御します。
h.FramesPerSecond = 10;
アニメーション オブジェクトを構成して、1 秒あたりのアニメーション データの秒数 (TimeScaling) プロパティを設定します。
h.TimeScaling = 5;
FramesPerSecond プロパティと TimeScaling プロパティの組み合わせによって、シミュレーションの時間ステップ (TimeScaling/|FramesPerSecond|) が決まります。これらの設定により、時間ステップは約 0.5 秒になります。
アニメーション オブジェクトのボディを作成して読み込みます。
idx1 = createBody(h,'pa24-250_orange.ac','Ac3d');
シミュレートされた飛行軌道データ (simdata) を読み込みます。
load simdata;本文の時系列データを設定します。
h.Bodies{1}.TimeSeriesSource = simdata;アニメーション オブジェクトの図オブジェクトを作成します。
show(h);

録音プロパティを設定します。
h.VideoRecord='on'; h.VideoQuality = 50; h.VideoCompression = 'Motion JPEG AVI'; h.VideoFilename = 'astMotion_JPEG';
アニメーションを TStart から TFinal まで再生します。
h.TSTart = 1; h.TFinal = 5; play(h);
現在のフォルダーに astMotion_JPEG.avi という名前のファイルが作成されたことを確認します。記録を再実行すると、シミュレーション時間の長さを記録したときの再生時間が前の例よりも短くなることに注意してください。
待機
オブジェクトを変更する前に、アニメーションの再生が停止するまで待ちます。
wait(h);
ファイルを保存するには録画を無効にします。
h.VideoRecord = 'off';この例では、仮想現実オブジェクトのアニメーション シミュレーションの 3 秒間の記録をスケジュールする方法を示します。
% Create an animation object. h = Aero.VirtualRealityAnimation; % Control the frame display rate. h.FramesPerSecond = 10; % Configure the animation object to set the seconds of animation data per % second time scaling (TimeScaling) property. h.TimeScaling = 5; % The combination of FramesPerSecond and TimeScaling properties determines % the time step of the simulation. These settings result in a time step of % approximately 0.5 s. % This code sets the .wrl file to use in the virtual reality animation. h.VRWorldFilename = 'asttkoff.wrl'; % Load the animation world described in the 'VRWorldFilename' field of the % animation object. h.initialize(); % Set simulation timeseries data. takeoffData.mat contains logged % simulated data. takeoffData is set up as a 'StructureWithTime', which is % one of the default data formats. load takeoffData [~, idxPlane] = find(strcmp('Plane', h.nodeInfo)); h.Nodes{idxPlane}.TimeseriesSource = takeoffData; h.Nodes{idxPlane}.TimeseriesSourceType = 'StructureWithTime'; % Use the example custom function vranimCustomTransform to correctly line % up the position and rotation data with the surrounding objects in the % virtual world. This code sets the coordinate transformation function for % the virtual reality animation. h.Nodes{idxPlane}.CoordTransformFcn = @vranimCustomTransform; % Set up recording properties. h.VideoQuality = 50; h.VideoCompression = 'Motion JPEG AVI'; h.VideoFilename = 'astMotion_JPEG'; % Set up simulation time from TFinal to TStart. h.TSTart = 1; h.TFinal = 5; % Set up to record between two and four seconds of the four second % simulation. h.VideoRecord='scheduled'; h.VideoTSTart = 2; h.VideoTFinal = 4; % Play the animation. h.play(); % Wait for the animation to stop running before modifying the object. h.wait(); % Verify that a file named astMotion_JPEG_VR.avi was created in the % current folder. When you rerun the recording, notice that the play time % is faster than when you record for the length of the simulation time. % Disable recording to preserve the file. h.VideoRecord = 'off';

制限
Aero.VirtualRealityAnimation オブジェクトは MATLAB Online ではサポートされていません。
バージョン履歴
R2007b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)