Random heightmap/texture generator
Random heightmap/texture generator
Does anyone know of a heightmap/texture generator that works with IrrLicht? I want to generate terrains, textures for them, and then apply them to a sphere. Something like Populous.
You can try Terragen.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
I want the program I'm making to generate them on the fly. Terragen would be nice if I wanted to make a huge amount of them, but I could just create hundreds of perlin noise clouds in Photoshop for that. I want my program to generate random heightmaps on the fly.Virion wrote:You can try Terragen.
Okay, I took the 2D code from this: http://freespace.virgin.net/hugo.elias/ ... perlin.htm and got it to compile without warnings or errors.
Now how on earth do I use it? When I print the results of PerlinNoise2D it's always something like -0.33399 .
I thought maybe that was it, how can I test to see if this is the case?bitplane wrote:that's one value. i guess you need to do that for each pixel
Edit: Okay, I currently have a 2 dimensional array (10 by 10) and I have a loop to fille it:
Code: Select all
void DrawGrid()
{
for(int x = 0; x < 10; x++)
{
for(int y = 0; y < 10; y++)
{
map[x][y]=PerlinNoise2D(x, y);
}
}
}
Code: Select all
ofstream mapfile;
mapfile.open("map.txt");
for(int x = 0; x < 10; x++)
{
for(int y = 0; y < 10; y++)
{
mapfile << map[x][y] << '\n';
}
}
mapfile.close();
Code: Select all
0.0371491
0.692023
0.496631
0.766835
-0.407069
-2.04812
-1.30434
-0.948782
-1.87947
-1.24445
-0.448668
-0.33399
-0.590847
-0.411724
-0.0696558
-0.462679
Edit 3:
Here we go:
Code: Select all
[0][0]=0.0371491
[0][1]=0.692023
[0][2]=0.496631
[0][3]=0.766835
[0][4]=-0.407069
[0][5]=-2.04812
[0][6]=-1.30434
[0][7]=-0.948782
[0][8]=-1.87947
[0][9]=-1.24445
[1][0]=-0.448668
[1][1]=-0.33399
[1][2]=-0.590847
[1][3]=-0.411724
[1][4]=-0.0696558
[1][5]=-0.462679
[1][6]=0.0111715
[1][7]=-0.171141
[1][8]=-1.90765
[1][9]=-1.0964
[2][0]=-0.283585
Also, I've got it generating a random seed now! Yay!
Is there a function to draw pixels in Irrlicht? How would I convert all these numbers to pixels?
Edit: How about that: http://libnoise.sourceforge.net/tutoria ... #heightmap
Edit 2: Stupid Code::Blocks never working:
.objs\main.o:main.cpp:(.text$_ZN5noise6module6PerlinD1Ev[noise::module::Perlin::~Perlin()]+0x16): undefined reference to `noise::module::Module::~Module()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
I've linked to all the header files and libraries, what does it want from me?
Edit: How about that: http://libnoise.sourceforge.net/tutoria ... #heightmap
Edit 2: Stupid Code::Blocks never working:
.objs\main.o:main.cpp:(.text$_ZN5noise6module6PerlinD1Ev[noise::module::Perlin::~Perlin()]+0x16): undefined reference to `noise::module::Module::~Module()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
I've linked to all the header files and libraries, what does it want from me?
hey RayOfAsh
I'm getting the same general error compiling libnoise using Dev-C++.
I was able to get it to compile using Visual Studio 2005 by adding the libnoise.lib file to the Configuration Properties > Linker > Input list.
If I could get libnoise to work with Dev-C++, I'd be more likely to use it since I only have VS2005 on my work machine.
--Carl
I'm getting the same general error compiling libnoise using Dev-C++.
I was able to get it to compile using Visual Studio 2005 by adding the libnoise.lib file to the Configuration Properties > Linker > Input list.
If I could get libnoise to work with Dev-C++, I'd be more likely to use it since I only have VS2005 on my work machine.
--Carl