• January 22, 2021, 01:51:12 PM

Login with username, password and session length

Author Topic:  Shaded displacement  (Read 177 times)

0 Members and 1 Guest are viewing this topic.

Offline iRyanBell

  • Strange Attractor
  • ******
  • Posts: 81
Shaded displacement
« on: January 13, 2021, 08:03:41 AM »
Using an orbit trap, we can use the cell escape value to matte paint through a stack of images rather than fill from a solid color palette, then use the shade as a rotational displacement across the image.

Experimenting with this idea...

Code: [Select]
func rotate(x float64, y float64, xm float64, ym float64, a float64) (float64, float64) {
a = a * math.Pi / 180.0
xr := (x - xm) * math.Cos(a) - (y - ym) * math.Sin(a) + xm
yr := (x - xm) * math.Sin(a) + (y - ym) * math.Cos(a) + ym

return xr, yr
}

...

depth := 10.0
cell, shade := computeColor(SIZE, SIZE, x, y, maxIter)
x2,y2 := rotate(float64(x), float64(y), 0, 0, shade*depth)

One approach is to use a modulus to wrap (x2, y2) to the confines of the target source image. Another approach is to scale the source layers to the target rendering size with
Code: [Select]
scale := float64(len(cellSourceImg))/float64(SIZE).


Linkback: https://fractalforums.org/programming/11/shaded-displacement/3983/
« Last Edit: January 13, 2021, 08:05:54 PM by iRyanBell »

Offline Adam Majewski

  • Fractal Frogurt
  • ******
  • Posts: 434
Re: Shaded displacement
« Reply #1 on: January 13, 2021, 04:48:24 PM »
looks great
 :thumbs:

Offline pauldelbrot

  • 3f
  • ******
  • Posts: 2423
Re: Shaded displacement
« Reply #2 on: January 13, 2021, 05:56:31 PM »
Is that a Kurosawa?

Offline iRyanBell

  • Strange Attractor
  • ******
  • Posts: 81
Re: Shaded displacement
« Reply #3 on: January 13, 2021, 08:08:54 PM »
Here's another example with a familiar face.

Offline iRyanBell

  • Strange Attractor
  • ******
  • Posts: 81
Re: Shaded displacement
« Reply #4 on: January 16, 2021, 05:37:47 AM »
The interpolation is a little shaky, but here's log(z^2) + z^-4 with a deep zoom out.