October 29, 2010

Nejibana (Twisting Flower)

さて。やっぱり単調に色を変えるだけじゃなくて情報も pass していかなければ物足りないので、カーブが急なほどゴールカラーに近づく、というのはどうでしょうか。

直行でゴールカラーになる、と決めてしまうと緩やかな曲線では変化が見られなくなってしまうので Loop 一周目で総当たり戦で AngleMax を返し、Loop 二周目で Angle/AngleMax の率に応じて色を変えてあります。これに前回のN次関数の変化率を組み合わせてみました。

'color blender according to angle
Dim aR, aG, aB 'factor for quadratic function
Dim t 'function
t = 3

aR = (gR-sR)/ (UBound(arr_str_tangent))^t
aG = (gG-sG)/ (UBound(arr_str_tangent))^t
aB = (gB-sB)/ (UBound(arr_str_tangent))^t

'with angle + quadratic
R = sR + Round(aR * ((UBound(arr_str_tangent))*( dbl_angle(0)/dbl_angle_max ))^t )
G = sG + Round(aG * ((UBound(arr_str_tangent))*( dbl_angle(0)/dbl_angle_max ))^t )
B = sB + Round(aB * ((UBound(arr_str_tangent))*( dbl_angle(0)/dbl_angle_max ))^t )

Call Rhino.ObjectColor( str_tangent, RGB(R,G,B) )
Call Rhino.EnableRedraw( True )

1 comment:

Ada said...

Hi! My name is ada and I am a M-Arch 1 student. I am recently having a research on Dragonfly by Tom wiscombe and Buro Happold. From ur blog I think you have participated in the installation. I would like to know more about that project. Would you mind to contact me for some more information? Please drop me an email to adadakayan@gmail.com. Many thanks.