Reputation: 319
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 .
Upvotes: 3
Views: 6403
Reputation: 1337
You can try the following:
from vedo 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()
Upvotes: 4
Reputation: 801
you can act like this:
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()
and for without texture, you'll find answer here
Upvotes: 2
Reputation: 2643
You can just use f3d for that : https://gitlab.kitware.com/f3d/f3d/-/releases
f3d /path/to/3dmodel.obj
Upvotes: 1