NOTE: i didn't test this, but im interested in this code and think ill try to modify the XNA triangle picking sample to do what you want.
To the RayIntersectModel() you would add Vector2's to hold the return texture coordinate's
static float? RayIntersectsModel(
Ray ray, Model model, Matrix modelTransform,
out bool insideBoundingSphere,
out Vector3 vertex1, out Vector3 vertex2,
out Vector3 vertex3, out Vector2 texCoord1,
out Vector2 texCoord2, out Vector2 texCoord3)
Right after this code, at line 368
// Keep track of the closest triangle we found so far
// so we can always return the closest one,
float? closestIntersection = null;
Add This:
int lookUpIndex = 0;
In the For(;;) loop after this code at line 393:
// Store the distance to this triangle.
closestIntersection = intersection;
Add This:
lookUpIndex = i;
At line 409 before the return, add this:
Vector2[] texCoords = (Vector2[])tagData["TexCoordinates"];
texCoord1 = texCoords[lookUpIndex + 0];
texCoord2 = texCoords[lookUpIndex + 1];
texCoord3 = texCoords[lookUpIndex + 2];
So you added texture coordinates to the model and have modified the 'TrainglePickingProcessor.cs" to recognize them and include them with the dictionary data referenced by 'model.tag' ?
I guess the idea is to use these texture coordinates to reference into the texture you have layed over your terrain ?