• allegro5.a5_display
  • allegro5.a5_file
  • allegro5.a5_font
  • allegro5.a5_image
  • allegro5.a5_joystick
  • allegro5.a5_main
  • allegro5.a5_misc
  • allegro5.a5_opengl
  • allegro5.a5_shader
  • allegro5.a5_sound
  • allegro5.a5_thread
  • allegro5.a5_triangles
  • animation
  • array
  • atlas
  • buffer
  • color
  • common
  • csg.csg_aabb
  • csg.csg
  • csg.csg_octree
  • csg.csg_shapes
  • csg.csg_test
  • data
  • display
  • exception
  • file
  • font
  • glsl
  • grid
  • hash
  • image
  • image_op
  • index
  • ini
  • isometric
  • joystick
  • keyboard
  • land
  • layer
  • list
  • log
  • main
  • map
  • mem
  • mouse
  • net
  • noise
  • openglutil
  • perlin
  • pixelmask
  • plasma
  • pool
  • protobuf
  • queue
  • random
  • runner
  • shader
  • sound
  • sprite
  • thread
  • tilegrid
  • triangles
  • util2d
  • util3d
  • util
  • view
  • voronoi
  • widget.base
  • widget.board
  • widget.book
  • widget.box
  • widget.button
  • widget.checkbox
  • widget.container
  • widget.edit
  • widget.gul
  • widget.hbox
  • widget.layout
  • widget
  • widget.menu
  • widget.mover
  • widget.panel
  • widget.scrollbar
  • widget.scrolling
  • widget.sizer
  • widget.slider
  • widget.spin
  • widget.text
  • widget.theme
  • widget.vbox
  • widget.widget_list
  • yaml.external
  • yaml.internal
  • yaml
  • yaml.xml

land.perlin

LandPerlin

land_perlin_create

Parameters: LandRandom * seed, int w, int h

Returns: LandPerlin*

Create a Perlin noise of the given resolution.

The noise at any integer coordinate is always 0. Other coordinates
return a random value in the range -1..1.

If w and h are 1, each noise sample will have the identical vector
at each corner.

For point 0.5/0.5 this means:

a = 0.5 * u + 0.5 * v
b = -0.5 * u + 0.5 * v
c = 0.5 * u + -0.5 * v
d = -0.5 * u + -0.5 * v
a + b + c + d = 0
result = 0

Also any other point:

a = x * u + y * v
b = -X * u + y * v
c = x * u + -Y * v
d = -X * u + -Y * v
e = X * a + x * b = xX * u + yX * v + -xX * u + xy * v
f = X * c + x * d = xX * u + -XY * v + -xX * u + -xY * v
result = Y * e + y * f =
         xXY * u + yXY * v + -xXY * u + xyY * v + xXy * u + -XYy * v + -xXy * u + -xYy * v
         u * (xXY - xXY + xXy - xXy) + v * (yXY + xyY - XYy - xYy)
         u * 0 + v * 0
         0

Note that this is not necessarily true for non-linear interpolation.

land_perlin_set_lerp_callback

Parameters: LandPerlin * self, float(* lerp)(float a, float b, float p)

land_perlin_set_lerp

Parameters: LandPerlin * self, LandPerlinLerp lerp

land_perlin_destroy

Parameters: LandPerlin * self

land_perlin_at

Parameters: LandPerlin * self, float x, float y

Returns: float

Get a noise value from a Perlin noise. If x/y are not from inside the resolution of the noise they will wrap around.

land_perlin_displace

Parameters: LandPerlin * self, float x, float y, float * xd, float * yd

Instead of getting the result of the Perlin noise at x/y, directly get the random displacement vector xd/yd.


Generated: Thu 27 Feb 2020 10:49:37 PM EST