View Full Version : Extract UVWMap rectangle?!
Hello!
I'm trying to extract the rectangle from a planar UVWMap modifier but I'm having some trouble with the transformation matrices..they just don't give the data I expect...
Of course I will eventualy understand this...don't know when thought...:(
The problem is when I transform the UVWmap Gizmo...I use "getModContextTM obj mod" but it doesn't show any rotation or scaling!??
Can someone give me some help?!
Thanks!!


Hello!
I'm trying to extract the rectangle from a planar UVWMap modifier but I'm having some trouble with the transformation matrices..they just don't give the data I expect...
Of course I will eventualy understand this...don't know when thought...:(
The problem is when I transform the UVWmap Gizmo...I use "getModContextTM obj mod" but it doesn't show any rotation or scaling!??
Can someone give me some help?!
Thanks!!
First of all, the UVW Map gizmo has a transformation matrix that is relative to the OBJECT space of the node it is applied to. This means that by default, the gizmo with identity matrix passes through the pivot point of the object and is aligned to its local axes.
Let's say that you have a Box and have applied a UVWMap modifier to it, then moved, rotated AND scaled the gizmo in an arbitrary position/orientation.
To align another object to fit the gizmo exactly, you would have to do the following:
Create a plane with width and length taken from the modifier
p = plane width:$Box01.modifiers[1].width length:$Box01.modifiers[1].length
Then take the TM from the gizmo, transform into the object space by multiplying by the node's TM and assign to the plane's TM  it should match the UV Gizmo perfectly...
p.transform = $Box01.modifiers[1].gizmo.transform * $Box01.transform
Hope this helps...
("The Matrix : Explained" DVD coming soon from CGAcademy! :))
Of course, this works with a rectangle, too (as you asked for it)
p = rectangle width:$Box01.modifiers[1].width length:$Box01.modifiers[1].length
p.transform = $Box01.modifiers[1].gizmo.transform * $Box01.transform
Or even better, as a function
fn makeRectangleFromUVWmap theNode theMod =
(
theObj = rectangle width:theMod.width length:theMod.length
theObj.transform = theMod.gizmo.transform * theNode.transform
theObj
)
makeRectangleFromUVWmap $Box01 $Box01.uvw_Mapping
Hello!
Sorry for the delay but...Thanks a lot!!! :)
Hello!
Sorry for the delay but...Thanks a lot!!! :)
No problem, glad I could help!
CGTalk Moderation
10182005, 12:35 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©20002014, Jelsoft Enterprises Ltd.