分为On-Screen Rendering 和 Off-Screen Rendering,分别指代GPU的渲染操作是在当前用于显示的屏幕缓冲区中进行还是在缓冲区之外另外开辟一块缓冲区进行渲染。
Off-Screen Rendering 的渲染成本较高,因为其需要新开辟缓冲区,且需要多次在当前屏幕和离屏之间进行切换。
在设定 shouldRasterize
, masks
, shadows
, edge antialiasing
, group opacity
中的一个或多个属性时,会触发 Off-Screen Rendering。
且当shouldRasterize
被设定时,不仅仅会触发Off-Screen Rendering,还会将Rasterize后的内容进行缓存,好处在于如果对应layer和sublayers没有变化,在下一帧就可以直接复用。
此外,Off-Screen Rendering还有一种特殊情况是CPU渲染。
import open3d as o3d
import numpy as np
ply = o3d.io.read_triangle_mesh(path)
points = np.array(ply.vertices) #转为矩阵
参考链接:
https://blog.csdn.net/suiyingy/article/details/124296483
python代码:
官方API文档:http://www.open3d.org/docs/release/python_api/open3d.io.write_point_cloud.html
pcd = o3d.geometry.PointCloud()
# the method Vector3dVector() will convert numpy array of shape (n, 3) to Open3D format.
# see http://www.open3d.org/docs/release/python_api/open3d.utility.Vector3dVector.html#open3d.utility.Vector3dVector
pcd.points = o3d.utility.Vector3dVector(pts)
# http://www.open3d.org/docs/release/python_api/open3d.io.write_point_cloud.html#open3d.io.write_point_cloud
o3d.io.write_point_cloud("my_pts.ply", pcd, write_ascii=write_text)
参考链接:
https://jdhao.github.io/2022/05/26/read_write_ply_file_python/
C++代码:
draw_geometries()
vis = o3d.visualization.Visualizer()
vis.create_window()
vis.add_geometry(pcd)
注意,多帧融合时的法向未必都是outward的,可以先单帧计算法向,通常来说,单帧得到的法线是正常outward的,究其原因,与坐标系的原点有关。
参考链接:
https://blog.csdn.net/u014072827/article/details/113766353
https://blog.51cto.com/u_11496263/1794693