Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to save the generated model as an obj+mtl file and import it into Blender. May I ask which UV coordinate values to pass in? #43

Open
Robintjhb opened this issue Jul 4, 2023 · 0 comments

Comments

@Robintjhb
Copy link

I want to save the generated model as an .obj + .mtl file and import it into Blender. May I ask which UV coordinate values to pass in?
if args.vis:
mesh = o3d.geometry.TriangleMesh()
mesh.vertices = o3d.utility.Vector3dVector(points[:, :3])
mesh.vertex_colors = o3d.utility.Vector3dVector(points[:, 3:] / 255.)
mesh.triangles = o3d.utility.Vector3iVector(faces)

    text = cv2.imread('assets/demo.png')

    
    mesh.triangle_uvs = o3d.open3d.utility.Vector2dVector(xyzrgb)  # ??????---triangle_uvs ???
    mesh.triangle_material_ids = o3d.utility.IntVector([0] * len(faces))
    mesh.textures = [o3d.geometry.Image(text)]

    #save .obj & .mtl 
    o3d.io.write_triangle_mesh('/home/demo01.obj', mesh)

截图_选择区域_20230704172530

截图_选择区域_20230704173421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant