Search code examples
htmlaframe.objwebvr

Why I do not see obj and mtl in this A-frame?


I am just getting started with a-frame 0.4.0 3d objects, but I think I make something basic wrong. I started as I see here: https://aframe.io/docs/0.4.0/components/obj-model.html and I used this model: http://tf3dm.com/3d-model/wood-texture-created-in-cycles-82780.html But this doesn't worked for me. Why? How can I do well?

<!DOCTYPE html>
    <html>
    <head>
        <title>objtest</title>
        <meta charset="utf-8">
    </head>
    <body>
    <a-scene>
      <a-assets>
        <a-asset-item id="tree-obj" src="WoodTexture.obj"></a-asset-item>
        <a-asset-item id="tree-mtl" src="WoodTexture.mtl"></a-asset-item>
      </a-assets>
      <a-entity obj-model="obj: #tree-obj; mtl: #tree-mtl"></a-entity>
    </a-scene>

    </body>
    </html>

Solution

  • did you use aframe.js? if not, try it. rename .obj and '.mtl' file without space. I have tried this model file, it works for me.