更改模型的初始位置和旋转
Change initial position and rotation of a model
使用加载特定模型的 A-Frame 获得了一个简单的 .html 文件。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Octant Cube - by Dodds, H. & Peres, T.</title>
<meta name="description" content="Present in the Taxonomy article">
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<a-assets>
<a-asset-item id="octant" src="octant.glb"></a-asset-item>
</a-assets>
<a-entity gltf-model="#octant"></a-entity>
</body>
</html>
对象在页面上加载正常 (as the documentation suggests) 但这是我最初看到的
如果我低头看,我能看到一架飞机
但希望在开始时看到以下内容
使用 A-Frame Inspector,我能够看到这非常适合位置 0、0.347、-3 和旋转 0、58.0274、-0.27。
我尝试将位置和旋转添加到 <a-assets>
和 <a-asset-item ... >
,但看不到任何变化。
如何改变模型的初始位置和旋转角度?
需要在 <a-entity>
中添加该信息,就像这样
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Octant Cube - by Dodds, H. & Peres, T.</title>
<meta name="description" content="Present in the Taxonomy article">
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<a-assets>
<a-asset-item id="octant" src="octant.glb"></a-asset-item>
</a-assets>
<a-entity position="0 0.347 -4" rotation="0 60 -1" gltf-model="#octant"></a-entity>
</body>
</html>
这是最终结果
使用加载特定模型的 A-Frame 获得了一个简单的 .html 文件。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Octant Cube - by Dodds, H. & Peres, T.</title>
<meta name="description" content="Present in the Taxonomy article">
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<a-assets>
<a-asset-item id="octant" src="octant.glb"></a-asset-item>
</a-assets>
<a-entity gltf-model="#octant"></a-entity>
</body>
</html>
对象在页面上加载正常 (as the documentation suggests) 但这是我最初看到的
如果我低头看,我能看到一架飞机
但希望在开始时看到以下内容
使用 A-Frame Inspector,我能够看到这非常适合位置 0、0.347、-3 和旋转 0、58.0274、-0.27。
我尝试将位置和旋转添加到 <a-assets>
和 <a-asset-item ... >
,但看不到任何变化。
如何改变模型的初始位置和旋转角度?
需要在 <a-entity>
中添加该信息,就像这样
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Octant Cube - by Dodds, H. & Peres, T.</title>
<meta name="description" content="Present in the Taxonomy article">
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
<a-assets>
<a-asset-item id="octant" src="octant.glb"></a-asset-item>
</a-assets>
<a-entity position="0 0.347 -4" rotation="0 60 -1" gltf-model="#octant"></a-entity>
</body>
</html>
这是最终结果