'Visualizing 3d models with textures
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 .
Solution 1:[1]
You can just use f3d for that : https://gitlab.kitware.com/f3d/f3d/-/releases
f3d /path/to/3dmodel.obj
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mathieu Westphal |
| Solution 2 |

