1

For my project, I have to select an area (set of triangles) and on mouse hover event, I have to change the color. As an input, I have a list of area and the set of triangle ID. I use an indexed buffergeometry. I also set a color attribute in order to change the face colors. enter image description here

The red box is my target area but when I change all colors of thoses vertex, It has an effect to another neighboor. What might be the reason?

EDITED

I am now using non indexed buffergeometry. I did not think that vertex coloring is a bit weird like this image below. enter image description here

Can I use geometry.groups to separate one surface in order to match it to one material?

RESOLVED

The result is due to my mistake because I did not think that colors array is a rgb value per vertex.

Valimo Ral
  • 381
  • 2
  • 15
  • 2
    You are sharing vertices. You need to use non-indexed `BufferGeometry` (a.k.a., triangle soup) so each triangle is separate from its neighbors. – WestLangley Dec 20 '18 at 23:33
  • see this answer for an explanation if neccessary: https://stackoverflow.com/questions/42141438/access-to-faces-in-buffergeometry/42167138#42167138 – Martin Schuhfuß Dec 20 '18 at 23:36
  • I have a constraint to use indexed geometry. But can I get my targeted triangles and render it separately? – Valimo Ral Dec 21 '18 at 09:09

0 Answers0