How to set the plane of the box primitive with different color

All about Windows versions
Post Reply
zzwbeyond
Posts: 15
Joined: Wed Mar 16, 2016 1:16 pm

How to set the plane of the box primitive with different color

Post by zzwbeyond »

Hello, I want set different color in different plane of the box primitive. And I have modify the 'buildUp' method in ccBox.cpp, but it don't work.

So is there any solution to do this? Thanks.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to set the plane of the box primitive with different color

Post by daniel »

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
zzwbeyond
Posts: 15
Joined: Wed Mar 16, 2016 1:16 pm

Re: How to set the plane of the box primitive with different color

Post by zzwbeyond »

Thanks daniel, I can set different color now.
And I want ask another question, how can I hide the bounding box of the box primitive or other primitive entity? I see other people have asked, but there is no answer.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to set the plane of the box primitive with different color

Post by daniel »

You mean programatically? If yes then you can simply call 'setSelected(false)'.
Daniel, CloudCompare admin
Post Reply