Page 1 of 1
How to build a cube with 8 vertex or a plane with 4 points in point cloud
Posted: Mon May 23, 2016 12:49 pm
by zzwbeyond
HI, I want to build a cube in cloudcompare with 8 points in point cloud, and the 8 points is the vertex of the cube. But CC now use the "dimensions" and a transformation matrix to build the "box" primitive. Or how to build a plane with 4 points, so I can build the cube with 6 planes.
Re: How to build a cube with 8 vertex or a plane with 4 points in point cloud
Posted: Mon May 23, 2016 8:32 pm
by daniel
The 'Box' and 'Plane' primitives really are primitives. And they can build a 3D tesselated representation just for display.
If you want to build a box from some given vertices, then you should create a standard triangular mesh (ccMesh). There are a few examples of creation of custom ccMesh instances in the code. Basically you create a point cloud (with 8 vertices), then you create a mesh with this point cloud as 'vertices' and you add the triangles (as 3 indexes referring to the vertices). You can also add per-triangle normals, etc. (in this case you can take a look at how a ccBox instance creates its own representation).