CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-07-2008, 04:46 PM   #1
pchela1313
New Member
 
pchela1313's Avatar
portfolio
Matthew Poplawski
Poland
 
Join Date: May 2005
Posts: 13
Blending transforms

Hi, I wrote a script that can save transforms for any objects. Also it shows a preview of stored poses. It works quite well, but now I want to add a slider that will blend between this poses. I made this slider but the problem is that the transforms blend in linear way.

Just like on this image:


But I want to make it blend based on circle curv. Because now it works like stretchy system. How can I made this to work?

Here is a part of script for this slider:
Code:
on BlendPosesSl changed i do ( if ca.count > 0 then ( for b = 1 to (ca.count-1) do ( --curTrans[b] - current Trasform of object that is stored --vals[b] - a saved pose temp2=vals[b] * PivotPose.node.transform temp4=(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) -- temporary matrix temp4.row1 = (temp2-curTrans[b]).row1 * [i,i,i] temp4.row2 = (temp2-curTrans[b]).row2 * [i,i,i] temp4.row3 = (temp2-curTrans[b]).row3 * [i,i,i] temp4.row4.x = (temp2-curTrans[b]).row4.x * i temp4.row4.y = (temp2-curTrans[b]).row4.y * i temp4.row4.z = (temp2-curTrans[b]).row4.z * i withBadScale = curTrans[b]+temp4 EndTransform = (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) -- another tomporary matrix EndTransform.row1 = withBadScale.row1 EndTransform.row2 = withBadScale.row2 EndTransform.row3 = withBadScale.row3 EndTransform.row4 = withBadScale.row4 EndTransform.row1 /= withBadScale.scalepart.x EndTransform.row2 /= withBadScale.scalepart.y EndTransform.row3 /= withBadScale.scalepart.z theSourceScale = vals[b].scalepart theTargetScale = EndTransform.scalepart EndTransform.row1 *= (theTargetScale.x + ((theSourceScale.x-1)* i)) EndTransform.row2 *= (theTargetScale.x + ((theSourceScale.x-1)* i)) EndTransform.row3 *= (theTargetScale.x + ((theSourceScale.x-1)* i)) AllObjects[b].node.transform=EndTransform ) ) )
 
Old 08-07-2008, 04:46 PM   #2
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:55 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.