Im finishing up two scripts, but im running into the same problem with both of them. So please, can we settle this once and for all: how exactly do the transform matrices work???
I have the following code:
Code: Select all
local v1 = LM.Vector2:new_local()
local v2 = LM.Vector2:new_local()
local vec = LM.Vector2:new_local()
local m = LM.Matrix:new_local()
v1.x = mouseEvent.startVec.x
v1.y = mouseEvent.startVec.y
v2.x = mouseEvent.vec.x
v2.y = mouseEvent.vec.y
moho.layer:GetFullTransform(moho.frame, m, moho.document)
m:Transform(v1)
m:Transform(v2)
vec = self.startPos + v2 - v1
bone.fAnimPos:SetValue(moho.frame, vec)
How can i transform the mouseEvent.vec vector so it compensates for all translations, rotations and scales on this layer, any of its parent layers and the camera?
I run into this bit code quite often and i imagine many others do too, so please lets get some final clarity on this!