kcc5
Class KCC_BallsTrap
Object
common:Generic
common:TrapShape
kcc5:KCC_BallsTrap
class
- TrapShape:KCC_BallsTrap
The 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 size parameter to produce a result similar
to the Balls mode in Carlson Orbit Traps in kcc3.ucl.
For an example of what this trap looks like,
click here.
Ultra Fractal Source
Toggle UF Source Code Display
class KCC_BallsTrap( common.ulb:TrapShape ) {
; The 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 size parameter to produce a result similar
; to the 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/Balls Trap.jpg">click here</a>.
;
public:
import "common.ulb"
; constructor
func KCC_BallsTrap( Generic pparent )
TrapShape.TrapShape( pparent )
endfunc
; call this before each sequence of values to be trapped
func Init( complex pz )
TrapShape.Init( pz )
endfunc
; call this for each iteration being trapped
float func Iterate( complex pz )
TrapShape.Iterate( pz )
b1 = real( pz ) * real( pz ) + (imag( pz ) - 0.5) * (imag( pz ) - 0.5)
b2 = real( pz ) * real( pz ) + (imag( pz ) + 0.5) * (imag( pz ) + 0.5)
b3 = (real( pz ) - 0.5) * (real( pz ) - 0.5) + imag( pz ) * imag( pz )
b4 = (real( pz ) + 0.5) * (real( pz ) + 0.5) + imag( pz ) * imag( pz )
if( b1 < @ballSize )
distance = b1
m_LastChannel = m_Iterations
m_Texture = distance / @ballSize
return distance
elseif( b2 < @ballSize )
distance = b2
m_LastChannel = m_Iterations
m_Texture = distance / @ballSize
return distance
elseif( b3 < @ballSize )
distance = b3
m_LastChannel = m_Iterations
m_Texture = distance / @ballSize
return distance
elseif( b4 < @ballSize )
distance = b4
m_LastChannel = m_Iterations
m_Texture = distance / @ballSize
return distance
else
return 1e20
endif
endfunc
float func GetTextureValue()
return m_Texture
endfunc
protected:
float distance
float b1
float b2
float b3
float b4
float m_Texture
default:
title = "Balls Trap"
int param v_KCC_BallsTrap
caption = "Version (KCC_BallsTrap)"
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_BallsTrap < 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 size parameter to produce \
a result similar to the Balls mode in Carlson Orbit Traps \
in kcc3.ucl."
endheading
float param ballSize
caption = "Balls Size"
default = 0.2
hint = "The size of the balls."
endparam
}
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 Object |
|
KCC_BallsTrap
public KCC_BallsTrap(Generic pparent)
- constructor
KCC_BallsTrap
public KCC_BallsTrap()
Init
public void Init(complex pz)
- call this before each sequence of values to be trapped
- Overrides:
Init
in class TrapShape
Iterate
public float Iterate(complex pz)
- call this for each iteration being trapped
- Overrides:
Iterate
in class TrapShape
GetTextureValue
public float GetTextureValue()
- Description copied from class:
TrapShape
- Get texture value.
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.
- Overrides:
GetTextureValue
in class TrapShape
- Returns:
- the texture value for the last point used (i.e. call GetTextureValue() after calling Iterate(), not before)