Permalink
Browse files

Bubble variation added

  • Loading branch information...
1 parent 2f7562b commit dafeaccf11d1d6adb17c94d959acee45e7802d4e @dbyrne committed May 28, 2010
Showing with 13 additions and 2 deletions.
  1. +5 −0 FractalComponents.scala
  2. +2 −2 FractalFlames.scala
  3. +6 −0 SampleFlames.scala
View
@@ -84,6 +84,11 @@ object FractalComponents {
Point(math.cos(t), math.sin(t)) * rp * w
}
+ def bubble(w:Double)=(p:Point) => {
+ val b = 4/(p.r2 + 4)
+ Point(p.x,p.y) * b * w
+ }
+
//Parametric variation
def curl(w:Double, c1:Double, c2:Double)=(p:Point) => {
val t1 = 1 + c1*p.x + c2*(p.x*p.x - p.y*p.y)
View
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
object FractalFlames {
def main(args: Array[String]){
- val renderer=new Renderer(1000,1000)
+ val renderer=new Renderer(1500,1500)
while (true) {
renderer.render()
}
@@ -40,7 +40,7 @@ class Renderer(xres:Int,yres:Int) {
val superSampling = 2
var values = Array.ofDim[Double](xres*superSampling,yres*superSampling,4)
- val flame = curlSample
+ val flame = bubbleSample
def render() {
View
@@ -20,6 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
object SampleFlames {
+ val bubbleSample = Flame((-1.75,0.75,-1.5,1.0), 3.25, Rainbow(),
+ scala.List[Function] (new Function(0.5, 0.0, (-0.559531, -0.253265, 0.253265, -0.559531, -0.187406, -0.073585)) {
+ override val variations = scala.List(linear(.2),bubble(.8))},
+ new Function(1.0, 1.0, (0.85214, -0.139685, -0.139686, -0.85214, -0.487627, -0.358286)) {
+ override val variations = scala.List(linear(.2),spherical(.8))}))
+
val julianSample = Flame((-2,2,-2,2), 4.00, Rainbow(),
scala.List[Function] (new Function(0.5, 0.0, (0.259446, 0.0972, 0.156567, -0.260863, 0.1, 0.0)) {
override val variations = scala.List(rings(1.0))},

0 comments on commit dafeacc

Please sign in to comment.