|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:TrapShape kcc5:KCC_TangentBallsTrap
class
The Tangent Balls trap.
When this trap is used with the Orbit Traps Direct (UF5) coloring in dmj5.ucl, the Trap Threshold value needs to be greater than or equal to the Balls Radius parameter to produce a result similar to the Tangent Balls mode in Carlson Orbit Traps in kcc3.ucl.
For an example of what this trap looks like,
click here.
class KCC_TangentBallsTrap( common.ulb:TrapShape ) { ; The Tangent Balls trap. ; <p> ; When this trap is used with the <em>Orbit Traps Direct (UF5)</em> ; coloring in dmj5.ucl, the Trap Threshold value needs to be greater ; than or equal to the Balls Radius parameter to produce a result similar ; to the Tangent Balls mode in <em>Carlson Orbit Traps</em> in kcc3.ucl. ; <p> ; For an example of what this trap looks like, ; <a href="../additional/kcc5/images/Tangent Balls Trap.jpg">click here</a>. ; public: import "common.ulb" ; constructor func KCC_TangentBallsTrap( Generic pparent ) TrapShape.TrapShape( pparent ) endfunc ; call this before each sequence of values to be trapped func Init( complex pz ) TrapShape.Init( pz ) m_Texture = 0.0 Dsqd0 = 0.0 Dsqd1 = 0.0 Dsqd2 = 0.0 ZtoPsqd = 0.0 Rc = @ballRadius Phi = #pi / 8 Rm = Rc / sin(Phi) RcSqd = Rc^2 Py = Rm * sin(2 * Phi) Px = Rm * cos(2 * Phi) endfunc ; call this for each iteration being trapped float func Iterate( complex pz ) TrapShape.Iterate( pz ) ; segment = 0 x = real( pz ) y = imag( pz ) Xabs = abs( x ) Yabs = abs( y ) float d = abs( ( cabs( pz ) - Rm ) ) if( d < Rc ) Dsqd0 = Xabs^2 + (Yabs - Rm)^2 Dsqd1 = (Xabs - Px)^2 + (Yabs - Py)^2 Dsqd2 = (Xabs - Rm)^2 + Yabs^2 if Dsqd0 < RcSqd ZtoPsqd = Dsqd0 if y > 0 m_LastChannel = 0 else m_LastChannel = 4 endif m_Texture = sqrt( ZtoPsqd / RcSqd ) return d elseif Dsqd1 < RcSqd ZtoPsqd = Dsqd1 if y > 0 && x > 0 m_LastChannel = 1 elseif y < 0 && x > 0 m_LastChannel = 3 elseif y < 0 && x < 0 m_LastChannel = 5 else m_LastChannel = 7 endif m_Texture = sqrt( ZtoPsqd / RcSqd ) return d elseif Dsqd2 < RcSqd ZtoPsqd = Dsqd2 if x > 0 m_LastChannel = 2 else m_LastChannel = 6 endif m_Texture = sqrt( ZtoPsqd / RcSqd ) return d endif return 1e20 else return 1e20 endif endfunc float func GetTextureValue() return m_Texture endfunc protected: float x float y float Xabs float Yabs float ratio float Dsqd0 float Dsqd1 float Dsqd2 float ZtoPsqd float Rc float Phi float Rm float RcSqd float Py float Px float m_Texture default: title = "Tangent Balls Trap" int param v_KCC_TangentBallsTrap caption = "Version (KCC_TangentBallsTrap)" default = 100 hint = "This version parameter is used to detect when a change has been \ made to the formula that is incompatible with the previous version. \ When that happens, this field will reflect the old version number to \ alert you to the fact that an alternate rendering is being used." visible = @v_KCC_TangentBallsTrap < 100 endparam heading caption = "Information" text = "When this trap is used with the Orbit Traps Direct (UF5) \ coloring in dmj5.ucl, the Trap Threshold value needs to be \ greater than or equal to the Balls Radius parameter to produce \ a result similar to the Tangent Balls mode in Carlson Orbit Traps \ in kcc3.ucl." endheading float param ballRadius caption = "Ball Radius" default = 0.1 hint = "The radius of the Tangent Balls." endparam }
Constructor Summary | |
---|---|
KCC_TangentBallsTrap()
|
|
KCC_TangentBallsTrap(Generic pparent)
constructor |
Method Summary | |
---|---|
float |
GetTextureValue()
Get texture value. |
void |
Init(complex pz)
call this before each sequence of values to be trapped |
float |
Iterate(complex pz)
call this for each iteration being trapped |
Methods inherited from class common:TrapShape |
---|
GetColorChannel, GetTransformedPoint, IterateSilent, SetThreshold |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public KCC_TangentBallsTrap(Generic pparent)
public KCC_TangentBallsTrap()
Method Detail |
---|
public void Init(complex pz)
Init
in class TrapShape
public float Iterate(complex pz)
Iterate
in class TrapShape
public float GetTextureValue()
TrapShape
Ordinarily, a trap shape does not have a native texture (it is flat). Some formulas may pair trap shapes with trap textures, and may need more information about trap textures when trap shapes are nested via TrapShapeMerge. This function provides support for accessing texture information.
GetTextureValue
in class TrapShape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |