Blending transforms

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  08 August 2008
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:

  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
  		)
  	)
  )
 
  08 August 2008
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



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 06:52 PM.


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