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

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

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

Postby zzwbeyond » Tue May 10, 2016 2:44 pm

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: 3375
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

Postby daniel » Tue May 10, 2016 3:04 pm

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

Postby zzwbeyond » Thu May 12, 2016 12:52 pm

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: 3375
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

Postby daniel » Thu May 12, 2016 6:46 pm

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


Return to “Windows related topics”

Who is online

Users browsing this forum: No registered users and 2 guests