3

I have a textured 3d model which has an obj file , mtl file and a png image for textures . I can visualize them without textures using trimesh and vtkplotter as :

//trimesh//
m = trimesh.load("3dmodel.obj")

//vtkplotter//
m = load("3dmodel.obj")

But they display the 3d models as plain meshes . I want to see them along with textures .

Can anyone please help me View the 3d models along with textures . Any small help would be greatly helpful .

4

3 回答 3

2

您可以尝试以下方法:

from vtkplotter import load

# https://free3d.com/3d-model/091_aya-3dsmax-2020-189298.html
mesh = load("091_W_Aya_100K.obj").texture("tex/091_W_Aya_2K_01.jpg")
mesh.lighting('glossy') # change lighting (press k interactively)

mesh.show()

在此处输入图像描述

于 2020-01-18T18:30:10.733 回答
1

你可以这样做:

import numpy as np
import trimesh
from PIL import Image

im = Image.open("Lmobl/texture.png")
mesh = trimesh.load('Lmobl/raw_model.obj',process=False)
tex = trimesh.visual.TextureVisuals(image=im)
mesh.visual.texture = tex
mesh.show()

结果如下: 在此处输入图像描述

对于没有纹理,你会在这里找到答案

于 2022-02-13T08:36:23.370 回答
1

您可以为此使用 f3d: https ://gitlab.kitware.com/f3d/f3d/-/releases

f3d /path/to/3dmodel.obj
于 2020-01-21T05:18:53.603 回答