Skip to content

OBJLoader how to add .mtl and .png texture #16

@brice-noowu

Description

@brice-noowu

I and thank you for your amazing work.

I have an .obj model that comes with a .mtl and a .png texture and I don't know how to add those two in a declarative way.

This is what I have in my scene for the moment :

<th-object3D loadObj url="assets/models/test.obj"> </th-object3D>

The model is loaded but comes with no textures. Is there a way to add the .mtl and .png declaratively, or do I have to grab a reference to the object3D with a template variable, and manipulate it from the controller ?

Thanks !

Edit :
I tried this, according to the doc :

    <th-mesh>
      <th-bufferGeometry loadObj
                         url="assets/models/test.obj"> </th-bufferGeometry>
      <th-meshStandardMaterial [args]="{ color: '#0055ff', flatShading: true }"></th-meshStandardMaterial>
    </th-mesh>

But the model still stays white 🧐

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions