| Ogre Setup Ogre Demo Ogre Tools CEGUI Ogre Export(Blender 2.49b) Ogre Export(Deled) SATCH (D'Fusion) 赤忍者モデル 関連ツール |
| ● AR(拡張現実) Ogre モデルを SATCH (D'Fusion)に取り込み、動作確認 → ARブラウザ「SATCH VIEWER」 SATCH Developers 3Dモデルにアニメーションが無くても、Luaスクリプトで簡易な移動・回転が可能 OGRE Exporters → http://www.ogre3d.org/tikiwiki/OGRE+Exporters ※ 2013.12.26: SATCH SDK及びそのサポートを終了 |
|||
SATCH Studio は @シーン内(シナリオ)に、光源(ライト)、オブジェクト(3Dモデル)を配置し、 AComputer Vison で、動画中にマーカーが有るか判断し、 Bマーカーが出現したら、シナリオで指定したオブジェクト(3Dモデル)を動画にリアルタイムで重ねて表示する。 Cマーカーが無くなれば、オブジェクト(3Dモデル)を隠す。(非表示にする) ※マーカーは、複雑な画像(写真等)を認識できる。 ※オブジェクト(3Dモデル)にアニメーションが付いていなければ、Luaスクリプトで簡易的なアニメーションができる。 |
![]()
| @ | モデルに複数のアニメーションが有る場合のアニメーション指定方法 |
![]() |
|
| A | 複数マーカーの対応方法 |
| ComputerVision で、複数のマーカーを登録し、 tracking.lua を修正する。 |
--******************************************************************************
--* tracking.lua for multi tracking *
--******************************************************************************
-- GLOBAL VARIABLES
-- tracking statuts: if 1 : tracking, if 0 : no tracking
gtrackingStatus = 0
gtrackingStatus2= 0 -- 2つめのトラッキングステータス
-- get the keyframe index from a tracked object with auto-initialization
gtrackingKeyFrameIndex = -1
gtrackingKeyFrameIndex2= -1 -- 2つめのトラッキングキーフレームのインデックス
-- scene
local scene = getCurrentScene()
-- get the virtual camera, will be used to send to the MLT
local camera = Camera(scene:getCurrentCamera())
-- get the videocapture, will be used to send to the MLT
local videoCapture_live = VideoCapture(scene:getObjectByName("videocapture_live"))
-- Tracking
local MLTPlugin = getMLTPluginManager()
-- Error status
local errorStatus = eOk
-- tracking index : the index of the tracker.xml (because we can open more than 1 tracking.xml file).
local trackingIndex = -1
-- the fps of the Tracking engine
local trackingRate = 0
-- vector to put the tracking position
local trackingPosition = Vector3()
-- quaternion to put the tracking orientation
local trackingOrientation = Quaternion()
-- 3D object receiving tracking pose
local trackingObject = Object3D(scene:getObjectByName("Tracking_Flower"))
local trackingObject2= Object3D(scene:getObjectByName("Tracking_Plant")) -- 2つめのトラッキングオブジェクト名
-- object index from the tracking scenario (0 : first object, 1 : second object...) (this is the index in the "Objects" panel of the CV GUI)
local trackingObjectIndex = 0
local trackingObjectIndex2= 1 -- ComputerVisionで登録したトラッキングオブジェクトのインデックス(0〜)
-- this is how to start a tracking. the function needs the path to the tracker.xml file, the videocapture id and the camera object.
errorStatus, trackingIndex = MLTPlugin:startTracking("tracker/tracker.xml", videoCapture_live:getVidCapID(), camera)
-- if the tracking has correctly started, we can proceed to an infinite loop
if errorStatus == eOk then
repeat
-- object1 check
errorStatus, gtrackingStatus = MLTPlugin:getTargetStatus(trackingIndex, trackingObjectIndex)
errorStatus, gtrackingKeyFrameIndex = MLTPlugin:getRecognizedKeyFrameIndex(trackingIndex, trackingObjectIndex)
if (gtrackingStatus == 1) then
MLTPlugin:getTargetPos(trackingIndex, trackingObjectIndex, trackingPosition, trackingOrientation)
trackingObject:setPosition(trackingPosition, camera)
trackingObject:setOrientation(trackingOrientation, camera)
if not trackingObject:getVisible() then trackingObject:setVisible(true) end
else
if trackingObject:getVisible() then trackingObject:setVisible(false) end
end
-- object2 check 2つめのトラッキングオブジェクトが出現したか調べる。(複数分同様に列挙して記述)
errorStatus, gtrackingStatus2 = MLTPlugin:getTargetStatus(trackingIndex, trackingObjectIndex2)
errorStatus, gtrackingKeyFrameIndex2 = MLTPlugin:getRecognizedKeyFrameIndex(trackingIndex, trackingObjectIndex2)
if (gtrackingStatus2 == 1) then
MLTPlugin:getTargetPos(trackingIndex, trackingObjectIndex2, trackingPosition, trackingOrientation)
trackingObject2:setPosition(trackingPosition, camera)
trackingObject2:setOrientation(trackingOrientation, camera)
if not trackingObject2:getVisible() then trackingObject2:setVisible(true) end
else
if trackingObject2:getVisible() then trackingObject2:setVisible(false) end
end
until coroutine.yield()
end
| ※ | SATCHでは1つのコンテンツでは4つまでを推奨 → http://satch.jp/jp/guide/manual_vl_4_4.html |
| 実行中のプロジェクトにつき、最大4 keyframe。 キーフレームの増加に伴いFPSレートが低下するため、パフォーマンスを考慮した制限です。 この4フレームは、処理内のMLT設定全体の合計値で組み合わせは自由。 |
|
| 可能な組み合わせ: 1キーフレームを持つ、4 オブジェクト 2キーフレームを持つ、2 オブジェクト 4キーフレームを持つ、1 オブジェクト |
|
|
Copyright (C) CRIMSON Systems |