normal_texture_path
是Open3D数据模块中的一项属性,属于PaintedPlasterTexture
纹理类型。该属性表示法线纹理的路径,用于计算在模型表面上的光照逐像素变化。
class open3d.data.PaintedPlasterTexture:
def __init__(self,
texture_path: str,
normal_texture_path: str,
uv_scale: Tuple[float, float] = (1.0, 1.0),
diffuse_color: Optional[Tuple[float, float, float]] = None,
ambient_color: Optional[Tuple[float, float, float]] = None)
texture_path
:纹理图的路径。normal_texture_path
:法线纹理的路径。uv_scale
:纹理坐标的缩小,可选。diffuse_color
:漫反射颜色,可选。ambient_color
:环境光颜色,可选。无返回值。
import open3d as o3d
mesh = o3d.geometry.TriangleMesh.create_from_triangle_arrays(vertices, triangles)
texture = o3d.io.read_image("texture.jpg")
normal_texture = o3d.io.read_image("normal.jpg")
plaster = o3d.data.PaintedPlasterTexture(texture_path='texture.jpg',
normal_texture_path='normal.jpg')
mesh.compute_vertex_normals()
mesh.paint_uniform_color([1, 0.75, 0.25])
mesh.compute_triangle_normals()
mesh.textures.append(texture)
mesh.textures.append(normal_texture)
mesh.textures.append(plaster)
o3d.visualization.draw_geometries([mesh])