# OpenSimplexNoise2 in JRubyArt

**URL:** <https://discourse.processing.org/t/opensimplexnoise2-in-jrubyart/28653>\
**Category:** Gallery\
**Created:** [March 19, 2021, 8:22am UTC](https://discourse.processing.org/t/opensimplexnoise2-in-jrubyart/28653 "2021-03-19T08:22:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [March 19, 2021, 8:22am UTC](https://discourse.processing.org/t/opensimplexnoise2-in-jrubyart/28653/1 "2021-03-19T08:22:21Z")

</div>

JRubyArt is soon to join PiCrate and propane in dropping processings PerlinNoise (brought to processing by Karsten Schmidt) in favour of a wrapper for [KdotJPG OpenSimplex2.java](https://github.com/KdotJPG/OpenSimplex2). I was inspired to do this by a post by [Etienne Jacob](https://necessarydisorder.wordpress.com/), here is one of his examples translated to the soon to be released JRubyArt (_with the new noise implementation_)

```ruby
# After a processing sketch by Etienne Jacob 
# see his blog https://necessarydisorder.wordpress.com
AMOUNT = 2.5
SCALE = 0.03
RADIUS = 0.45
FRAMES = 100

def field(x, y)
  count = frame_count - 1
  value1 = 400.0 * noise(SCALE * x, SCALE * y, RADIUS * cos(TWO_PI * 1.0 * count / FRAMES),
                         RADIUS * sin(TWO_PI * 1.0 * count / FRAMES))
  value2 = 400.0 * noise(1000 + SCALE * x, SCALE * y, RADIUS * cos(TWO_PI * 1.0 * count / FRAMES),
                         RADIUS * sin(TWO_PI * 1.0 * count / FRAMES))
  # int value2 = (int) Math.round(value)
  parameter1 = value1 / FRAMES
  parameter2 = value2 / FRAMES
  # if(random(100)<1) println(parameter)
  Vec2D.new(AMOUNT * parameter1, AMOUNT * parameter2)
end

def settings
  size(500, 500)
end

def setup
  sketch_title 'Experiment 6'
end

def draw
  background(0)
  grid(width - 300, height - 300, 5, 5) do |i, j|
    stroke(255, 25)
    no_fill
    pos = Vec2D.new(i + 150, j + 150)
    point(pos.x, pos.y)
    200.times do
      res = field(pos.x, pos.y)
      res *= 0.15
      pos += res
      point(pos.x, pos.y)
    end
    point(pos.x, pos.y)
  end
  # puts frame_count
  save_frame(data_path('fr###.tiff'))

  return unless frame_count == FRAMES

  # save_frame(data_path('expt6.png'))
  no_loop
  puts 'finished'
end

```

![ezgif-3-a69b42517110](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c45ee7ef7d12e66e337f8a11b9ad1e8b6cb50875.gif)

For more stuff like this check out [Etienne Jacob](https://twitter.com/etiennejcb) on twitter.
