Please help me with terrain generation!

Started by dangerdoc, May 16, 2012, 16:41:48

Previous topic - Next topic

dangerdoc

I have asked this before, and I have gotten answers. I could not learn what I needed from those answers. I need an explanation of the process that is involved in 3-D trillinear terrain generation. I have searched for a long time but have not found something that I can understand. I think visually, and I need an explanation about what this (example) means:

value += fractX       * fractY       * fractZ       * noise[x1][y1][z1];
   value += fractX       * (1 - fractY) * fractZ       * noise[x1][y2][z1];
   value += (1 - fractX) * fractY       * fractZ       * noise[x2][y1][z1];
   value += (1 - fractX) * (1 - fractY) * fractZ       * noise[x2][y2][z1];

   value += fractX       * fractY       * (1 - fractZ) * noise[x1][y1][z2];
   value += fractX       * (1 - fractY) * (1 - fractZ) * noise[x1][y2][z2];
   value += (1 - fractX) * fractY       * (1 - fractZ) * noise[x2][y1][z2];
   value += (1 - fractX) * (1 - fractY) * (1 - fractZ) * noise[x2][y2][z2];

means. I cant make sense of code like that without an explanation. How do you process the information, and what is the reason for each line of code? If I learn to do 3-D trillinear interpolation, I am willing to make a tutorial that explains it to others like me. Thank you for reading this post, and thank you even more if you are willing to walk me through this.

dangerdoc
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla