Search found 23 matches

by Alastriona
Sun Apr 18, 2010 2:27 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

Hmm, maybe try with a 129x129 field first. Maybe something breaks due to the change from 16bit to 32bit indices. Nope thats not it. I'm going to take a little break and clear my head. Then I should prolly start over from scratch and only add exactly what I need so no other code could possibly be er...
by Alastriona
Sun Apr 18, 2010 2:19 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

Both code frags should basically work. Use floats instead of doubles in the first code. And don't forget to fill the array of ints in the second version. I am still getting access violations, but that must be somewhere else in my code then. Strangely when I remove the rawloader line it works fine. ...
by Alastriona
Sun Apr 18, 2010 1:21 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

I'm totaly stuck on this. What I currently am trying (assume terrainArray is initialized): int terrainArray[257*257]; io::IReadFile* file = device->getFileSystem()->createMemoryReadFile(&terrainArray, 257*257*sizeof(int), "heightmap"); scene::ITerrainSceneNode* terrain = smgr->addTerra...
by Alastriona
Sat Apr 17, 2010 10:48 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

How do I use the RAW loader? I can't seem to create an empty instance of ITerrainSceneNode*? I need an instance of the ITerrainSceneNode to call the raw loader right?

P.S. I'm really tired, maybe I'm missing something.
by Alastriona
Sat Apr 17, 2010 10:19 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

hybrid wrote:Better create a memory read file from your array and use the RAW loader of terrain scene node. You can directly load any number array with ints or floats.
Alright ill try this.
by Alastriona
Sat Apr 17, 2010 7:21 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

Thanks for the response bonsalty. I think I get most of what you mean. I'm guessing this means that I will have to overload the loadHeightMap() function to take an Iimage and then construct an IterrainSceneNode manually and call my overloaded loadheightmap function? Browsing through documentation a...
by Alastriona
Sat Apr 17, 2010 6:49 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

Thanks for the response bonsalty. I think I get most of what you mean. I'm guessing this means that I will have to overload the loadHeightMap() function to take an Iimage and then construct an IterrainSceneNode manually and call my overloaded loadheightmap function? Browsing through documentation an...
by Alastriona
Sat Apr 17, 2010 3:48 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3269

Generating terrain from a plain c++ array

Hello, 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: char[height*width] terrain = new char[height*width]; Now I have code that will save this to an i...