What I'm trying to get:
I'm trying to decorate the interior of a baroque chapel with a oval floor plan and cupola with stucco ornaments. The best way I could come up with was to do a UV unwrap of the plain walls, that define the overall shape of the room, create a planar "pelt" model of the UV. This gives me a canvas of sorts to place the 3d modeled ornaments. Then, using the relative position of the ornament's points to the unwrapped copy of the model to project them onto the real 3d thing.
How and why I want to go about it:
In some cases, the ornaments extend a bit over the seams of the UV islands and of course, they are 3d.
My idea was to use a Ray SOP to project the points of the ornament to the closest surface on the UV model. By comparing the old and new position of the points, I could get a vector, that would allow me to move the points back into their unflattened position(not only along the new surface normal of the chapel walls), once in place. To move them into the correct position, I would need to rotate this vector by the same transform, that is between the surface of the unwrapped model, and the surface of the original chapel walls.
My problem:
And this is where I come to my problem. I am absolutely unable to define the transformation of the vector I want to use to unflatten the geometry correctly in respect to the original geometry. Since the unflattening vector not limited to copying the surface normal of the walls, it's important, that it be transformed taking into account the U and V vectors of the unwrapped and original geometry pair.
Now I've found lots of ways to define a rotation while researching this, but they mostly look for the shortest way to rotate a vector to a new position. What I would need though, would be to rotate the vector using a transform derived from two planes, not just two vectors.
The "lookat" function in VEX has a "upvector" input, but even after many attempts, I never got the results I expected.
Basically, I'm at the end of my wits, so any tips on how to define a transformation in a more robust fashion, using 2 sets of two vectors, or two planes would be much appreciated.
Cheers,
Ivan