When loading an objects from the assets manager in Aframe, the model appears too large, so I want to rescale it.
On the Aframe website, it is stated that If you don’t see your model, try scaling it down. OBJ models generally have extremely large scales in comparison to A-Frame’s scale.
But how can I do this? I tried to use the same depth/height/width parameters as in a element but no success.
Here is my code:
<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>
The scale
component is what you want, for external models:
<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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With