Standard
Class Standard_GlassHemisphere

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by Standard:Standard_GlassHemisphere

class 
UserTransform:Standard_GlassHemisphere

Object version of GlassHemisphere in Standard.uxf. Glass hemisphere effect. Originally written by Luke Plant.


Ultra Fractal Source

Toggle UF Source Code Display

 class Standard_GlassHemisphere(common.ulb:UserTransform) {
 ;
 ; Object version of GlassHemisphere in Standard.uxf.
 ; Glass hemisphere effect.
 ;
 ; Originally written by Luke Plant.
 ;
 public:
   complex func Iterate(complex pz)
     complex c = @ctr
     if @screencenter
       c = #center
     endif
 
     complex z2 = pz - c
     float x1 = 0
     float y1 = 0
     float beta = 0
     float theta1 = 0
     float x2 = 0
 
     float x1 = cabs(z2)/@width
     if x1 > 1
       return pz
     else
       ; refraction calcs
       theta1 = acos(x1)
       y1=sin(theta1)
       beta = asin(x1/@n)
       x2 = -y1/real(tan(theta1+beta))+ x1
       return z2/x1 * x2 + c
     endif
   endfunc
   
 default:
   title = "Glass Hemisphere"
   helpfile = "Uf*.chm"
   helptopic = "Html/transformations/standard/glasshemisphere.html"
   param n
     caption = "Refractive index"
     default = 2.0
     hint = "Refactive index of 'glass'"
   endparam
   param width
     caption = "Width"
     default = 1.0
     hint = "Width of hemisphere"
   endparam
   complex param ctr
     caption = "Center"
     default = #center
     enabled = !@screencenter
     hint = "Center of hemisphere"
   endparam
   param screencenter
     caption = "Use Screen Center"
     default = false
     hint = "If set, the hemisphere will be at the center of the \
             window, regardless of the Center setting."
   endparam
 }
 


Constructor Summary
Standard_GlassHemisphere()
           
 
Method Summary
 complex Iterate(complex pz)
          Transform a single point within a sequence
 
Methods inherited from class common:Transform
Init, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

Standard_GlassHemisphere

public Standard_GlassHemisphere()
Method Detail

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value