Can TerraGen Worlds be used in Blitz 3D Programs?

Blitz3D Forums/Blitz3D Programming/Can TerraGen Worlds be used in Blitz 3D Programs?

WedgeBob(Posted 2006) [#1]
Hi, I was wondering something about those ".TGW" files from TerraGen, and/or the terrain files from TerraGen. If I were to create a mesh terrain, and have the sky built in TG, could I include those files into a 3D environment in Blitz 3D, or would I have to recreate that in Maya PLE? Even then, how would that be included with Blitz 3D, and used as an interactive environment?


Jams(Posted 2006) [#2]
1) You could export the heightmap out of terragen and use it with LoadTerrain.
2) Then you could do an orthographic render of the terragen terrain to get a texture map for it.
3) Then you could a panoramic render of the sky and map it to a skybox (not sure how to do that but i'm sure it's possible).


To get a heightmap out of terragen, you need to go into the terrain editor and press print screen, then in your graphics app, crop the image so you just have the grayscale heightmap (it should be 512x512). You'll probably want to blur it slightly aswell... Save it out, and then a simple call to LoadTerrain( file$ ) in blitz3d will give you what you want.

For the texture map, apply your surface settings (or load a preset) in the terrain editor, then in the atmosphere editor, make sure you turn off haze & fog and such. Then in the main render window, go to camera set up and select orthographic projection. That'll give you a top down render of the terrain, which you can save and load as a texture in b3d.


WedgeBob(Posted 2006) [#3]
That sounds great, and it should be worth trying. I'll look around to getting that done. At least it's easier to do than going through that Maya PLE junk to do the same thing, and that you have to design your terrain from the ground up, which can be frustrating in Maya to go through all that.


Rob Farley(Posted 2006) [#4]
http://www.blitzbasic.com/codearcs/codearcs.php?code=447


John Blackledge(Posted 2006) [#5]
Hey Rob - nice code.

Too bad all terrains come out green and don't acknowledge Terragen's colour settings ???


WedgeBob(Posted 2006) [#6]
Yeah, maybe Jams' suggestion may be a little better, since you are using Blitz 3D's native code for terrain meshes. However, I don't see where you can use multiple textures for the terrain. Like, let's say you added a river or lake to the terrain, and you have mountains and banks on the side. The mountains and banks are made of grass, but to add a water texture, what would you do to add a separate texture for the H2O?


WedgeBob(Posted 2006) [#7]
To clarify my last post, I used water in my last terrain world in TerraGen, and Blitz 3D doesn't seem to pick that up at all. It shows up as blue (for TerraGen, the program knows that it's water, and uses it as such), however, in Blitz 3D, this seems to change the terrain altogether, and does not render the water at all, and of course, you need a second texture to make it as water, and change the trench in the terrain shot into gray for Blitz 3D to pick it up, which doesn't sound easy. How would you fix Blitz 3D to recognize the water in an easier way?


Picklesworth(Posted 2006) [#8]
There's another free terrain generator called L3DT which pulls off terrains just as good as Terragen's, with the only difference being that it works for games, offers a bit of extra customization, and has no renderer.

Thread about it here:
http://www.blitzbasic.com/Community/posts.php?topic=52132

I use it and I think it's excellent! I've also successfully run an L3dt-generated terrain in a B3d program along with textures and all that stuff.


WedgeBob(Posted 2006) [#9]
Ahh, that looks cool. However, I also see that L3DT's coming out with a Professional edition which seems to do better yet. However, how would the Standard vs. Professional impact through B3D development?


SheepOnMintSauce(Posted 2006) [#10]
For water, could you not draw a cube underneath the terrain which would be the water? You could then alter the height of the cube to lower or raise the waterlevel.

Something like this..



S'cuse the picture, It was a quick 2 minute diagram. =)


Rob Farley(Posted 2006) [#11]
I use a plain rather than a cube... save's 10 triangles!




SheepOnMintSauce(Posted 2006) [#12]
Even better! =)


WedgeBob(Posted 2006) [#13]
Okay, I'll see how that all comes together. I used that example of building a fjord in L3DT, that looked awesome. So, using that example, that should almost come together in B3D without too many issues. It seems like in the L3DT viewer, vs. duplicating that in B3D would probably involve more than I think, would it not?

Okay, I can see that it exports into .HFF files. However, I'm not too sure how B3D can read HFF when it comes to including those files into redeveloping the terrain and textures into B3D at all, or do you have to "Print Screen" the terrain and the textures you want again? I thought I read in that L3DT thread that those terrain maps could easily be transferred in 100% accurately.


Picklesworth(Posted 2006) [#14]
It exports regular images as well.

As I recall, the HFF files are not entirely necessary... I think they're just for the viewer.


WedgeBob(Posted 2006) [#15]
I should've seen where that option was. The only export option I saw was the .HFF one. Unless you mean the "Print Screen" option, then that may take a while to get those topography lines eliminated, because those may make the terrains in B3D very bumpy and frightening looking.