Hey there WLGfx,

Sorry for the delay on this post, I've been tied down to real life and haven't had much time for coding. I wanted to share this little utility thing that I wrote up to help me visualize the plugins.

It's nothing special, but I found it useful as a total newbie to visualize what the numbers were doing in terms using the noise to generate terrain. The simplex plugin was hard to control because it's so darn fast... so I added a delay in there to have some more control over the values.

Here's the code. If I'm not using something correctly let me know and I'll update this.

Rem ***** Included Source File *****
REMSTART
#### WLGfx's commands for PERLIN NOISE
NOISE GET HEIGHT ==(pn,x,y)
NOISE GET HEIGHT TILED ==(pn,x,y,width,height)
NOISE SET PARAMS ==pn,pers,freq,ampl,oct,seed
NOISE GET PERSISTANCE ==(pn)
NOISE GET FREQUENCY ==(pn)
NOISE GET AMPLITUDE ==(pn)
NOISE GET OCTAVES ==(pn)
NOISE GET RANDOMSEED ==(pn)
NOISE SET PERSISTANCE ==pn,pers
NOISE SET FREQUENCY ==pn,freq
NOISE SET AMPLITUDE ==pn,ampl
NOISE SET OCTAVES ==pn,oct
NOISE SET RANDOMSEED ==pn,seed
NOISE GET HEIGHT BYTE ==(pn,x,y)
NOISE GET HEIGHT BYTE ABS ==(pn,x,y)
NOISE GET HEIGHT BYTE TOP ==(pn,x,y)
NOISE GET HEIGHT TILED BYTE ==(pn,x,y,width,height)
NOISE GET HEIGHT TILED BYTE ABS==(pn,x,y,width,height)
NOISE GET HEIGHT TILED BYTE TOP==(pn,x,y,width,height)
#### WLGfx's commands for SIMPLEX NOISE
float val = SIMPLEX NOISE 2D(octaves,persistence,scale,x,y)
float val = SIMPLEX NOISE 3D(octaves,persistence,scale,x,y,z)
float val = SIMPLEX NOISE 4D(octaves,persistence,scale,x,y,z,w)
float val = SIMPLEX SCALED 2D(octaves,persistence,scale,lo,hi,x,y)
float val = SIMPLEX SCALED 3D(octaves,persistence,scale,lo,hi,x,y,z)
float val = SIMPLEX SCALED 4D(octaves,persistence,scale,lo,hi,x,y,z,w)
float val = WL FSQRT(val)
WL MATRIX NORMALISE matrixID
REMEND
RANDOMIZE TIMER()
Set Display Mode 800 , 600 , 32
sync on : sync rate 120 : color backdrop 0
autocam off
rpn = 0 : rpers# = 0 : rfreq# = 0 : rampl# = 0 : roct# = 1.0 : rseed = 0 : rscale# = 0
iSeg = 128 `Number of segment points to take height
iLength = 256 `The overall length of each axis of the matrix
`#### MAKE CAMERA
MAKE CAMERA 1
POSITION CAMERA 1,(iLength)/2,300,((iLength)/2)-200
XROTATE CAMERA 1,60
SET CAMERA RANGE 1,1,10000
`#### MAKE CAMERA
MAKE MATRIX 1,(iLength),(iLength),iSeg,iSeg
POSITION MATRIX 1,0,0,0
inoise = 0
DO
IF inoise = 0 : snoise$ = "Perlin " : ELSE : snoise$ = "Simplex " : ENDIF
SET CURSOR 0,0
ink RGB(255,0,0), RGB(0,0,0)
print "FPS:";screen fps()
print "You are currently viewing " + snoise$ + "noise. Press F1 to change."
SELECT inoise
CASE 0:
print "PN: " + str$(rpn)
print "PERS: " + str$(rpers#)
print "FREQ: " + str$(rfreq#)
print "AMPL: " + str$(rampl#)
print "OCT: " + str$(roct#)
print "SEED: " + str$(rseed)
IF KEYSTATE(59) = 1 : WAIT 500 : inoise = WRAP(inoise+1,0,1) : ENDIF
`Q key increases / A key decreases PN value by 1
IF KEYSTATE(16) = 1 THEN WAIT 500 : rpn = WRAP(rpn+1,0,7) : keydown = 1
IF KEYSTATE(30) = 1 THEN WAIT 500 : rpn = WRAP(rpn-1,0,7) : keydown = 1
`W key increases / S key decreases PERS value
IF KEYSTATE(17) = 1 THEN rpers# = rpers# + 0.01 : keydown = 1
IF KEYSTATE(31) = 1 THEN rpers# = rpers# - 0.01 : keydown = 1
`E key increases / D key decreases FREQ value
IF KEYSTATE(18) = 1 THEN rfreq# = rfreq# + 0.01 : keydown = 1
IF KEYSTATE(32) = 1 THEN rfreq# = rfreq# - 0.01 : keydown = 1
`R key increases / F key decreases AMPL value
IF KEYSTATE(19) = 1 THEN rampl# = rampl# + 0.01 : keydown = 1
IF KEYSTATE(33) = 1 THEN rampl# = rampl# - 0.01 : keydown = 1
`T key increases / G key decreases OCT value
IF KEYSTATE(20) = 1 THEN WAIT 500 : roct# = roct# + 1.0 : keydown = 1
IF KEYSTATE(34) = 1 THEN WAIT 500 : roct# = roct# - 1.0 : keydown = 1
`Y key increases / H key decreases SEED value
IF KEYSTATE(21) = 1 THEN WAIT 500 : rseed = rseed + 1 : keydown = 1
IF KEYSTATE(35) = 1 THEN WAIT 500 : rseed = rseed - 1 : keydown = 1
IF keydown = 1
NOISE SET PARAMS rpn, rpers#, rfreq#, rampl#, roct#, rseed
print "keydown"
FOR x = 0 TO iSeg
FOR z = 0 TO iSeg
hgt# = abs(NOISE GET HEIGHT TILED(rpn,x,z,iSeg,iSeg)) * 255
set matrix height 1,x,z,hgt#
NEXT z
NEXT x
UPDATE MATRIX 1
keydown = 0
ENDIF
ENDCASE `ENDCASE for Perlin section
`Simplex noise
CASE 1:
SET MATRIX WIREFRAME OFF 1
UPDATE MATRIX 1
print "SCALE: " + str$(rscale#) + " -- Keep this small... maybe .004?"
print "PERS: " + str$(rpers#) + " -- Manipulate this a bit to get your details "
print "OCT: " + str$(roct#) + " -- Around 5 octaves works really well!"
`E key increases / D key decreases FREQ value
IF KEYSTATE(18) = 1 THEN WAIT 100 : rscale# = rscale# + 0.0001 : keydown = 1
IF KEYSTATE(32) = 1 THEN WAIT 100 : rscale# = rscale# - 0.0001 : keydown = 1
`W key increases / S key decreases PERS value
IF KEYSTATE(17) = 1 THEN rpers# = rpers# + 0.001 : keydown = 1
IF KEYSTATE(31) = 1 THEN rpers# = rpers# - 0.001 : keydown = 1
`T key increases / G key decreases OCT value
IF KEYSTATE(20) = 1 THEN WAIT 500 : roct# = roct# + 1.0 : keydown = 1
IF KEYSTATE(34) = 1 THEN WAIT 500 : roct# = roct# - 1.0 : keydown = 1
IF keydown = 1
print "keydown"
FOR x = 0 TO iSeg
FOR z = 0 TO iSeg
hgt# = simplex scaled 2d(roct#, rpers#, rscale#, 0, 255, x, z )
if hgt# < 0 then hgt# = 0
if hgt# > 255 then hgt# = 255
set matrix height 1,x,z,hgt#
NEXT z
NEXT x
WL MATRIX NORMALISE 1
UPDATE MATRIX 1
keydown = 0
ENDIF
ENDCASE `ENDCASE for Simplex section
ENDSELECT `SELECT inoise
SYNC
LOOP