CGTalk Brain twister (Bubble Bias)
 10-03-2012, 11:40 PM #1 JokerMartini Expert   portfolio John Martini CG Supervisor, 3D, Maxscript, VFX Ingenuity Engine Los Angeles, USA   Join Date: Mar 2009 Posts: 1,310 Brain twister (Bubble Bias) Here is a new one I've been messing around with today in my freetime. It's an attempt at a bubble bias. Where both ends are condensed and the middle is stretched thin. In the example I used boxes and adjust there placement on the z axis. Check it out. I do believe there is a more efficient way of doing this. I'm still in the process of messing with it but feel free to chyme in and mess with it. I'm hoping to implement a way where the bias control for both ends could be independent from one another. Code: ``` totalHeight = (units.decodevalue "100cm") count = 21.0 sz = (units.decodevalue "3cm") clearlistener() endBias = .4 --range -1.0 1.0 biasStrength = 1.0 --range 1.0 100.0 fn fnCreateBoxes = ( fn biasCalc f bias:0.0 power:1 = ( if bias < 0 then 1 - (pow (1 - f) (1 - power*bias)) else (pow f (1 + power*bias)) ) for k = 0.0 to count-1 do ( middle = (count-1)/2 bubble = if k == middle then 0.0 else if k > middle then (endBias*-1) else (endBias) format "% - %\n" k bubble f = k/(count-1) h = biasCalc f bias:bubble power:biasStrength obj = box width:sz height:sz length:sz pos:[0,0,(totalHeight*h)] print obj.pos.z ) ) delete objects fnCreateBoxes()``` __________________ ____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com share quote
 10-03-2012, 11:40 PM #2 CGTalk Moderation Lord of the posts   Join Date: Sep 2003 Posts: 1,066,478 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. share quote