You'll have to add 'materials' to the primitive:
- define 6 materials (one per face). The color should be set on the 'diffuse' component of the material.
- then add per-triangle material indexes
- define the index for each triangle (each face of the box has 2 triangles)
- and don't forget to set 'showMaterials' to true
Daniel, CloudCompare admin