Getting UV coordinates from raytrace hit

Hi all,

So I’ve been getting familiar with bits and pieces of this engine, but before I know whether I can proceed to use it for my current project, I need to know if some things are doable. I used Unity for a quick test of the concept, and managed to get it working quite nicely in there. Basically I had a render texture set as a decal layer on a mesh, and I used a raytrace to get UV coordinates from the mesh when the ray hit it, then copied a texture to the render texture each hit. Is this something which I can reproduce in Panda? I saw that the Bullet API has a method “getTriangleIndex” from the hit, and the egg package seems to have methods that might let me get the UV coords, but I figured it’d be better to ask the experts about this before I go barking up the wrong tree. Thanks.

One approach is discussed here:

The idea is to create a texture with a gradient and apply it to the model, and then render that into an offscreen buffer from the ray’s position, and render it at a very low resolution. Then you read out the pixel value, and youĺl be able to read the U,V out of the pixel colour.

That’s a pretty awesome method there. I think it might even give me some added flexibility over the Unity method which was looking a bit jaggy at times. Thanks a lot.