Iterate terrain blocks
by Erik Madison · in Torque Game Engine · 12/03/2004 (3:08 am) · 5 replies
I'm going to try an experiment, and I could use a push.
How do I loop all the terrain blocks in code? If this is already done somewhere, please point me to the file.
Thanks,
How do I loop all the terrain blocks in code? If this is already done somewhere, please point me to the file.
Thanks,
About the author
#2
have a look in the terrain*.cc files
12/03/2004 (6:16 am)
I think he wants to loop through the tb's via c++ code to-do some kind of manipulationhave a look in the terrain*.cc files
#3
So, I'm pondering a method of looping the terrain blocks, the 8x8 chunks, and deciding the type and shape of my replication based on the predominate texture. I would only do this once, so it would be no slower than the dozens of replicators I now use.
I haven't fully thought this out, nor looked over any current terrain file, just yet. It's still at that 'Hmm, I wonder' stage :)
12/03/2004 (7:47 am)
Actually, what I'm thinking of is a method to 'paint' foliage. I have good code chunks in all the fxReplicator files that control placement and rendering. I'm just not happy with how they pick areas. So, I'm pondering a method of looping the terrain blocks, the 8x8 chunks, and deciding the type and shape of my replication based on the predominate texture. I would only do this once, so it would be no slower than the dozens of replicators I now use.
I haven't fully thought this out, nor looked over any current terrain file, just yet. It's still at that 'Hmm, I wonder' stage :)
#4
12/03/2004 (8:07 am)
TerrData.cc would be a good place to start looking for example code. They do a variety of parsing (from shadow generation to rendering, etc.) through the terrain itself.
#5
12/03/2004 (8:13 am)
There was also a resource that allows you to be able to move only when on certain textures(to keep you on a path, for instance). You can look in there for sampling the terrain textures, and use the results to modify what replication occurs in those areas.
Torque 3D Owner Ted Southard