摄影机动画始终从初始摄影机姿势开始。
我们不想要这种行为。
你可以使用:https://app.3d.io/default_setup来检查这个问题。
这段代码以前是有效的。我们什么都没改变。
<a-entity camera="" tour="autoStart: false" wasd-controls="" look-controls="" position="-2.073 1.6 -1.474" rotation="-2.063 203.308 0">
<a-entity tour-waypoint="Top View" io3d-uuid="add7b140-7563-463a-b324-75e2b460e915" position="-7.959815433483447 22.172638840745442 1.675735956699384" rotation="-89.9 450 0"></a-entity>
<a-entity tour-waypoint="Living" io3d-uuid="486a6760-e8d1-456d-a2d0-5358d65b2ef1" position="1.1168750348397785 1.037108274040117 1.7797448740972899" rotation="0 412.98472385428914 0"></a-entity>
<a-entity tour-waypoint="Kitchen" io3d-uuid="4a0f17c1-fcde-4706-9188-48ddeb808927" position="-0.4316313757947364 1.37 0.10205065263211961" rotation="0 491.46180963572306 0"></a-entity>
<a-entity tour-waypoint="Dining" io3d-uuid="5d76c74b-a2b5-4ddf-a6e9-a6fe009377b7" position="-1.0699430785395438 8 -3.5236261145326577" rotation="-38.48648648648648 539.873168157716 0"></a-entity>
<a-entity tour-waypoint="Bedroom" io3d-uuid="4d6fec29-1467-40be-8f91-5435f0317072" position="-9.650512503727434 8 2.1338268605968826" rotation="-59.152761457109314 594.7591069330199 0"></a-entity>
<a-entity tour-waypoint="Bedroom" io3d-uuid="3851ec4b-53c0-47d4-afc2-3d646043eb5d" position="-9.639031885443684 8 5.539305773258945" rotation="-56.77438307873098 400.8960173400832 0"></a-entity>
<a-entity tour-waypoint="Master Bedroom" io3d-uuid="97eabbe1-578a-48ee-a40f-60af0187f2b1" position="-13.334875006116892 8 -1.701906768812833" rotation="-59.08108108108104 494.6322427235562 0"></a-entity>
<a-entity tour-waypoint="Top View" io3d-uuid="fe33bb66-b1fe-4d13-9904-2e98fc05a525" position="-7.959815433483447 22.172638840745442 1.675735956699384" rotation="-89.9 450 0"></a-entity>
</a-entity>
这段代码也不能像预期的那样工作。摄像机仍然保持不变的位置。
document.querySelector('[camera]').components['tour'].updateViewPoint({position:{y:1.6}, rotation:{x:0}})
发布于 2017-12-19 20:49:50
事实证明,在迁移到版本4.x.x的aframe-animation-component中有一个突破性的变化,如果您发现自己正在使用以下方式来包含该组件:
<script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script>你想把它改成下面这一行:
<script src="https://unpkg.com/aframe-animation-component@3.2.5/dist/aframe-animation-component.min.js"></script>发布于 2017-12-19 17:27:21
漫游动画将始终从当前摄影机位置补间到下一个巡视点。因此,您要做的是在aframe源代码中或以编程方式将相机设置到起始位置:
<a-entity camera position="x y z"></a-entity>或通过JavaScript:
document.querySelector('[camera]').setAttribute('position', 'x y z');然后,您可以通过编程方式设置下一个路点:
document.querySelector('[camera]').components['tour'].goTo(waypointUuid)或者,您可以开始浏览:
document.querySelector('[camera]').components['tour'].playTour()如果这对你不起作用,请描述你想要的结果,并与小故障或应用程序创建者分享你的代码。
https://stackoverflow.com/questions/47879021
复制相似问题