Paint where my CollisionNode is pointing


#1

Hi again, i have a new problem with my project.

The thing is that i have an Actor with Joints that i control with ControlJOints, now i have put collisionnodes with CollisionSolids(spheres) in where the controlJoints(JOints) are. Now i want that if you collision the mouse(CollisionRay) with some of the CollisionNodes(Spheres) the color of that part of the Actor changes of colour.

I am trying to do it but i dont find anything that get me for example the mash or the vertex that the CollisionNOde is Collisioning with.

Some help please.

I dont know hoy change only some part of my Actor


#2

If you are colliding with separate meshes, you should be able to get the node corresponding to the part you are directly colliding with, and apply a state (colour change) directly to it. This does require the GeomNodes making up your Actor to be separate.

If those parts aren’t separate, another approach is to use a texture and paint on it. This is rather tricky because you would need to know which parts of the texture map correspond to which joint.

Finally, if you instead decide to do skinning in a shader (search the forums), it becomes easier as you can write your shader to respond to inputs indicating whether a joint is selected or not. Then, you can use the weights to apply the desired colour to that part of the mesh.