pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
noiselib

noiselib - 1.4.0

Chandler Armstrong (omnirizon)

Tags:

Description

noiselib provides noise generators and manipulators. noiselib is modeled after libnoise, the C++ coherent noise library. noise generators are wrapped in 'modules' that manipulate, modify, filter, and combine noise generators. Each module expects and returns noise; thus modules can be stacked to create complex noise output.

Changes

1.4.0
* The noise modification callback functions are now passed as handles to those functions, rather than a string. This permits more user freedom in supplying their own callbacks.
* Corrected a mistake in the Rescale module. Thanks to bugmenot for catching this.

2.0.0
* The noise modification callback functions are now passed as handles to those functions, rather than a string. This permits more user freedom in supplying their own callbacks.
* Corrected a mistake in the Rescale module. Thanks to bugmenot for catching this.
* The fractal Brownian motion function is now implemented in C. This does not change the interface at all.

I will shortly release a minor update that adds docstrings, a windows binary, and a short reference document. Please be patient!

NOTE: a special release is not made here for the 2.*.* versions. If you are interested in them, simply find them on the host site, linked below.

Links

Home Page: http://code.google.com/p/noiselib/
Source: https://sourceforge.net/projects/noiselib/files/

Screenshot


click to view original size

Releases

noiselib - 1.5.0 - Jul 27, 2011
noiselib - 1.4.0 - Jun 8, 2011

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

May 28, 2011 3:37pm - Chandler Armstrong - nickname: (omnirizon)
the interface will only change in one place. the 'f' parameter, a callback function for the fBm procedure to modify per-octave noise, will change to accept the function object rather than a string. this is so users can make their own callback functions.

I have finally gotten everything to compile with no errors. I may test tonight and then release if all goes well.
May 24, 2011 8:05pm - Bugme Not - nickname: (bugmenot) - 5/5
Ooh, I'd really like to see that pre-compiled installer; I'm trying to share my game with my friend right now and he has to install mingw32 and everything.

Will the python interface be at all different for the new fBm? I just hope that nothing is broken.
May 23, 2011 1:20pm - Chandler Armstrong - nickname: (omnirizon)
thanks for the catch on the mistake, bugme not!

I'm updating this package to implement the fBm in C. I'll fix the mistake you found, and add a comment to the scale function, if its logic is unclear. You basically stated why the scale function looks the way it does; I wanted a particular signature. A saner way of implementing the function may exist; I'll look into it.

The update will be released today or tomorrow. I'll distribute it with an actual installer, code compiled and all.
May 22, 2011 4:44pm - Bugme Not - nickname: (bugmenot)
The code is completely undocumented; the most important thing I figured out is:

The scale() function is actually a line in y=mx+b form, equivalent to the line between the two given points. So give RescaleNoise a line f and it'll transform all of the noise points x (in range -1 to 1) to new noise points f(x) in the range f(-1) to f(1).

Why is the line given as two points instead of as a y-intercept and a slope? Because of the convenience of this:
source = RescaleNoise((-1, 1), (0, 1), source) means that noise between -1 and 1 is mapped to noise between 0 and 1, which can be used by RGBLerpNoise
May 22, 2011 3:44pm - Bugme Not - nickname: (bugmenot) - 3/5
In your AbsNoise function, you have:

def __call__(self, coords):
source = self.source
return abs(noise(coords))

But there is no `noise' in scope. Do you mean:

def __call__(self, coords):
source = self.source
return abs(source(coords))
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Jul 28, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

Jul 19, 2014

Jul 15, 2014

Jul 10, 2014

Jul 9, 2014

Jun 27, 2014



Jun 24, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)