I've been messing around with procedural terrain generation (using fractals) the last few weeks. My algortihm basicly creates a heightmap in a plain (2D) array of chars.
The array looks like this:
Code: Select all
char[height*width] terrain = new char[height*width];
The problem I'm having with this is that its kind of overkill to save to an image and then load it into Irrlicht. What I would like is to use my 2D array directly to provide height values for Irrlicht to use. Since my array is basicly representing a 8-bit grayscale image I'm pretty sure this should be possible.
My questions are:
- Has anyone ever done something similar, and is this code freely available?
- If not, do you guys think it would be hard to implement into Irrlicht?
P.S. I hope the description of my situation is sufficient. I didn't wanna end up with a huge wall of text. Feel free to ask for clarification if needed.