Code archives/Graphics/Heightmap Toolbox V0.3.6

This code has been declared by its author to be Public Domain code.

Download source code

Heightmap Toolbox V0.3.6 by impixi2006
A self-contained class of heightmap creation, processing, exporting, and importing utilities.
See below...

Comments

impixi2006
Heightmap Toolbox 0.3.6

(the core Heightmap class)

hmap03.6.bmx:




impixi2006
test1.bmx:




test2.bmx:




impixi2006
test3.bmx:




test4.bmx:




impixi2006
test5.bmx:




test6.bmx:




impixi2006
..


Booticus2006
Man thanks again for this Impixi! Always love a good terrain generation nugget!


impixi2006
..


impixi2006
..


impixi2006
..


Booticus2006
Rules. As always! Thanks Impixi!


impixi2008
Heightmap Toolbox has been updated to Version 0.3.2

Changes:

0.3.2
* Removed method exportX3D
* Removed method lowerPerimeter
* Added method Islandise
* Added method lowerCenter


impixi2008
Heightmap Toolbox has been updated to Version 0.3.3

Changes:

0.3.3
* Modified importPNG
* Modified importImageFile
* Modified exportShadowsPNG
* Modified exportPNG - now uses format PF_RGB888
* Modified exportColorPNG - now uses format PF_RGB888
* Modified exportTexturePNG - now uses format PF_RGB888
* Modified renderToPixmap - now uses format PF_RGB888
* Modified renderRectToPixmap - now uses format PF_RGB888
* Modified renderToColorPixmap - now uses format PF_RGB888
* Modified renderRectToColorPixmap - now uses format PF_RGB888
* Modified renderToTexturePixmap - now uses format PF_RGB888
* Added method importPixmap
* Added method clone


Macguffin2008
This is really excellent stuff, impixi. Thanks!


Riva2008
Thats what i was looking for.
Thanks.

One Question to the Perlin Noise Stuff.
I try to generate some PN Maps.
I setting the SEED value to any fixed Number (not Millisecs) and play around whit the scale and multipler values to see whats going on. But the Scale value dosn't work when you set seed to a fix value.
You can set scale to any value you want. No changes happen.

Sorry for my bad english.


impixi2008


But the Scale value dosn't work when you set seed to a fix value.




Ah yes, you're correct. I'm not sure why. Will have to investigate further...


impixi2008
Incidentally, Heightmap Toolbox V0.4 is sort of done, but I'm not sure whether to post it or not. There are significant changes, with some algorithms ported to C code, and the BlitzMax side of things now uses TBanks instead of 2d arrays. Consequently, some algorithms are significantly faster, while others are slightly slower.

Perhaps I need to release it as a pre-compiled module now? I don't know - that could be a real nuisance.

EDIT 26-Aug-08: For simplicity's sake I've reverted back to pure BlitzMax code. Version 0.3.6 incorporates the latest changes.


Riva2008
Hi impixi,

i find out why Scale dosn't Work with a fix Seed value.

SeedRnd(seed)  '<<<< 1
Local size:Int = Width
Local NoiseMapSize:Int = Floor(size / 2)
Local max_height:Float = scale
Local NoiseMap:Float[NoiseMapSize + 1, NoiseMapSize + 1]

For Local x:Int = 0 To (size - 1)
    For Local z:Int = 0 To (size - 1)
        Map[x, z] = RndFloat() * scale   '<<<<< 2
    Next
Next


Later in the code Rnd ist used again.
I think that scale will work with a fix Seed value if you set the
SeedRnd(seed) '<<<< 1
Line deeper under the 2 For Next Blocks.


impixi2008
No, that does not seem to make a difference for me, but thanks for your efforts anyway.


impixi2008
Heightmap Toolbox has been updated to Version 0.3.6

RECENT CHANGES

0.3.5

* Removed COLORMAP_DISCREET constant - Superceded by new STYLE_DISCREET constant
* Removed COLORMAP_BLENDED constant - Superceded by new STYLE_BLENDED constant
* Removed TEXTUREMAP_DISCREET constant - Superceded by new STYLE_DISCREET constant
* Removed TEXTUREMAP_BLENDED constant - Superceded by new STYLE_BLENDED constant
* Removed resize method - inappropriate, superceded by the new Create function
* Removed blendMapsRep function - superfluous
* Removed createParticleSMap method - superceded by generateParticleMap
* Removed createParticleRMap method - superceded by generateParticleMap

* Added STYLE_DISCREET constant
* Added STYLE_BLENDED constant
* Added METHOD_STICKY constant
* Added METHOD_ROLLING constant
* Added Create function - more appropriate and convenient than resize
* Added generate ParticleMap method - combines both previous particle algorthims and adds some extra algorithm customization

* Modified renderToTexturePixmap - now accepts pre-existing pixmap arrays or urls

* Renamed createRandomMap to generateRandomMap - more appropriate name
* Renamed createHillMap to generateHillMap - more appropriate name
* Renamed createFaultMap to generateFaultMap - more appropriate name
* Renamed createPerlinMap to generatePerlinMap - more appropriate name
* Renamed createMPDMap to generateMPDMap - more appropriate name
* Renamed TVector class to TSimpleVector - minimize potential naming conflicts with other imported code


0.3.6

* Removed exportPNG - superfluous
* Removed exportColorPNG - superfluous
* Removed exportTexturePNG - superfluous
* Removed exportShadowsPNG - superfluous

* Modified generatePerlinMap algorithm - simplified: one less parameter


Ian Thompson2008
Excellent stuff, very interesting, thank you. :)


Code Archives Forum