2

I am new to open3D and working on a process to automatically create mesh's of various terrains and apply generated maps on those terrains. I have been using open3D to view the meshes, but I'm not sure how to project my png onto that mesh.

Code

import open3d as o3d
import open3d.visualization.rendering as rendering

material = rendering.MaterialRecord()
material.shader = 'defaultUnlit'
material.albedo_img = o3d.io.read_image('terrain_image.png')

mesh = o3d.io.read_triangle_mesh("terrain_mesh_file.stl")
mesh = mesh.compute_vertex_normals()
o3d.visualization.draw({'name': 'terrain', 'geometry': mesh, 'material': material})

This is showing the mesh, but the image does not seem to mapped onto it in any way:

enter image description here

Here are the files I am working with

Mesh enter image description here Image enter image description here

Alternatively, if I use one of the primitive meshes I'm able to successfully map the image onto the mesh.

material = rendering.MaterialRecord()
material.shader = 'defaultUnlit'
material.albedo_img = o3d.io.read_image('terrain_image.png')

box = o3d.geometry.TriangleMesh.create_box(create_uv_map=True)
o3d.visualization.draw({'name': 'box', 'geometry': box, 'material': material})

enter image description here

This almost certainly has something to do with the uv_mapping which I do not fully understand yet. I get that it is a mapping of 0,1 to translate my image onto the mesh, but I dont understand how I would construct one in this scenario.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.