【发布时间】:2022-06-22 19:49:41
【问题描述】:
我希望我的 A 帧相机位于模型后面并作为 TPP 工作。我希望模型与相机同步并旋转和移动相机移动的任何位置,但如果相机上下指向它不应该移动它不应该看起来像模型卡在相机上。
<html>
<head>
<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v3.13.1/dist/aframe-extras.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/aframe-physics-components@1.1.0/dist/aframe-physics-components.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@^4.0.0/dist/aframe-event-set-component.min.js"></script>
<script src="https://unpkg.com/super-hands@^3.0.1/dist/super-hands.min.js"></script>
</head>
<body>
<a-scene physics="gravity: -9.8; restitution: 0.7;" antialias="true">
<a-assets>
<img id="ground-grass" src="grass.jpg" />
</a-assets>
<a-entity universal-controls="" camera kinematic-body=""
position="-2.9021956210846644 1.5405810531492952 -3.927244596410301"></a-entity>
<a-plane src="#ground-grass" scale="50 50 1" repeat=" 5 5 1" rotation="-90 0 0" static-body></a-plane>
<a-box color="#AA0000" scale="2 2 2" position="-2.5 0.5 -7.5" static-body></a-box>
</a-scene>
</body>
</html>
如果我移动相机,盒子也应该移动。 Output image
【问题讨论】:
标签: javascript three.js aframe webvr