运行时报错view_frustum.transform(np.hstack([rotation, viewpoint.reshape(3, 1)])) TypeError: transform(): incompatible function arguments. The following argument types are supported: 1. (self: open3d.cpu.pybind.geometry.Geometry3D, arg0: numpy.ndarray[float64[4, 4]]) -> open3d.cpu.pybind.geometry.Geometry3D Invoked with: TriangleMesh with 22 points and 40 triangles., array([[-1.0000000e+00, -1.2246468e-16, 0.0000000e+00, 0.0000000e+00], [ 1.2246468e-16, -1.0000000e+00, 0.0000000e+00, 0.0000000e+00], [ 0.0000000e+00, 0.0000000e+00, -1.0000000e+00, 0.0000000e+00]])
时间: 2024-03-12 17:44:41 浏览: 127
data_arrange.rar_Frustum_Frustum culling
这个错误可能是由于`viewpoint`不是一个形状为`(3,)`的numpy数组导致的。请确保`viewpoint`是一个形状正确的numpy数组,并且在传递给`view_frustum.transform()`函数之前,将其转换为一维数组。例如,可以使用以下代码来生成`viewpoint`并将其转换为一维数组:
```
viewpoint = np.array([0, 0, 0])
view_frustum.transform(np.hstack([rotation, viewpoint.reshape(3, 1)]))
```
如果你已经这样做了,那么请检查`rotation`数组和`viewpoint`数组的形状是否正确。`rotation`应该是一个形状为`(3, 3)`的numpy数组,`viewpoint`应该是一个形状为`(3,)`的numpy数组。
阅读全文