The below example shows a ready-made 3D model downloaded from Google Blocks – the 3D model is a rocket shown beside three primitives.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<head> <title>A-frame primitives & 3D object demo</title> <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script> </head> <body> <a-scene> <a-assets> <a-asset-item id="mtl" src="./materials.mtl"></a-asset-item> <a-asset-item id="obj" src="./model.obj"></a-asset-item> </a-assets> <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere> <a-box position="-1 0.5 -3" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"></a-box> <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder> <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane> <a-sky color="#ECECEC"></a-sky> <a-entity obj-model="obj: #obj; mtl: #mtl;" position="5.395 1.892 -1.221" scale="1 1 1"> </a-entity> </a-scene> </body> |