BIMsurfer-before2019 icon indicating copy to clipboard operation
BIMsurfer-before2019 copied to clipboard

Change Color not working on every element

Open 9on opened this issue 9 years ago • 4 comments

In the V2 branch the model loads great, all the colors are correct. But, after using setColor() on some of the elements, even though the object.material.diffuse property is defined correctly, the color does not change (the alpha works as expected).

In the attached IFC example, the elements with the problem are the green beams. examp.zip

9on avatar Sep 23 '16 22:09 9on

I came across the exact same problem. I worked around it by adding: material.emissive = [color[0], color[1], color[2]]; after the line material.diffuse = [color[0], color[1], color[2]]; in _setObjectColor in src/xeoViewer/xeoViewer.js

I guess that the proper way to to it would be to modify either the diffuse or the emissive property depending on the object type. I am not sure what is the criteria though.

bastienmenis avatar Sep 24 '16 18:09 bastienmenis

Thanks for the help, changing the material.emissive property worked on a few of the conflictive elements. Since the geometry also has colors i understood that the elements were "painted" at least 3 times.

  • at geometry creation
  • at object's material creation
  • at material.diffuse redefinition (setColor())

the solution that worked for me was commenting the definition of the geometry color

Not sure if i should close the issue. If i understood correctly, the problem now would be a conflict between the material's color and colored geometries.

9on avatar Sep 27 '16 13:09 9on

Hello, I would like to ask how to separate each window to display a different color, like this:

emv_5qy vnrb1 xn 9ha zj

Thank you!

raintao avatar Mar 29 '17 01:03 raintao

@raintao Hi. I am also trying to find same kind of solution with small difference. I want to override selected element color with default color on some event. can you help me here ?

dishesh avatar Oct 11 '18 07:10 dishesh