缩放框架模型

Scaling Aframe model

在Aframe中从资产管理器加载对象时,模型显得太大,所以我想重新缩放它。

在 Aframe 网站上,声明 如果您没有看到您的模型,请尝试将其缩小。与 A-Frame 的比例相比,OBJ 模型通常具有非常大的比例。

但是我该怎么做呢?我尝试使用与元素中相同的 depth/height/width 参数但没有成功。

这是我的代码:

<html>
  <head>
    <script src="https://aframe.io/releases/0.3.2/aframe.min.js"></script>
  </head>
  <body>
  <a-scene>
    <a-assets>
      <a-asset-item id="test-obj" src="test.obj"></a-asset-item>
      <a-asset-item id="test-mtl" src="test.mtl"></a-asset-item>
    </a-assets>
    <a-obj-model src="#test-obj" mtl="#test-mtl" depth="2" height="0.5" width="0.5">
    </a-obj-model>
  </a-scene>
  </body>
</html>

scale组件就是你想要的,对于外部模型:

<a-obj-model src="#test-obj" mtl="#test-mtl" scale="0.1 0.1 0.1">
</a-obj-model>

https://aframe.io/docs/0.3.0/components/scale.html