How to dynamically change the color of a point in a point cloud?

I added color to the point cloud through the polyData.getPointData().setScalars() method. Now I need a hover effect. When the mouse moves over a point, it changes the color of the point. I have obtained the index of the point through the HardwareSelector class. How can I set the color of the point independently?

You need to give your point a specific scalar value, and have in your color table a “hover” color associated with the specific scalar value.

Alternatively, you can also create a sphere actor that you place onto your moused over point :slight_smile:

I don’t know how to associate “hover” color with the specific scalar value~
I temporarily created a sphere actor.

Another question, I want to set the color of a point separately. For example, how do I set the 10th point in the point cloud to red? I have an idea now, which is to change the color array, and then set the color for the point cloud again. But is there a simple way to change the color of a point directly.