more robust transformation controls

   523   2   1
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
Hi, sorry in advance for the lenghty post.

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
User Avatar
Member
8535 posts
Joined: July 2007
Offline
your needs are equivalent to tangent space normal map or vector displacement
so as with both of those you can define tangent space from uv attribute
in SOPs you can use Polyframe to generate UV gradient vectors and use those with N to create a transform matrix on your flat and 3d geo
then just transform your vector from one to another as you need
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
Wow! thanks Tomas! it works now! I definitely owe you at least a beer by now.
  • Quick Links