About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
OK, i think i found the
OK, i think i found the answer myself:
---- rotate pivot only function
fn RotatePivotOnly obj rotation= (
local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
---- new ray from 2 points
newpos1 = [0,0,0]
newpos2 = [20,20,20]
vector_dir = ray newpos1 newpos2
---- create a transformation matrix from the ray
rowZ = normalize vector_dir.dir
rowY = [0,0,1]
rowX = normalize (cross rowY rowZ)
rowY = cross rowZ rowX
trfm = matrix3 rowX rowY rowZ [1,1,1]
RotatePivotOnly obj (trfm)
----- end of script