Loading pre-made terrain

hello!
so heres what im trying to do: i created some nice terrain in blender, and i made a grass texture for it. im sure i could just texture it in blender but i like the way TerraMonkey gets the job done. its easier to understand. so my terrain is just a texture-less mass. first of all, for some reason whenever i view the .j3o file created from my terrain’s .obj file, its completely black. i made sure lights where on. i even tried adding a bunch of lights. but its still black. if i add more terrain to the scene by generating it with TerraMonkey it works this new generated terrain looks great. Textures and all. So first question: how do i use TerraMonkey with a .obj or .j3o i already created?

My big question though: when you use TerrainQuads in actual coding(and correct me if im wrong) it seems that it’s a way for JME to store the terrain in blocks to maximize performance speed, like say if youre a certain distance from one terrain quad, it minimizes the amount of vertices, or just stops rendering it altogether. and this may be totally off, cause its just what im guessing after messing around with TerraMonkey… I mean, im pretty much a nooblet. but theres got to be a big drop in performance between using one solid mass of terrain compared to using a bunch of different TerrainQuads and just mashing them together. its for this reason that i decided it would be necessary to use TerrainQuads with the terrain i created in blender. so i have it split up in different (separate) .obj’s. Then i realized, i have no idea how to use TerrainQuads with .obj’s. i’ve only ever seen it used for random terrain, with heightmaps. so my question is, finally, how can you make a TerrainQuad that holds the vertices of a .obj you’ve already created? Also, if my speculations were wrong, please correct me :slight_smile: i need to learn more about everything.

Well the most simple question would be, if you use your whole block, is the remaining performance still good enough? if so just ad a texture with and and be happy that you saved yourself quite some time for the moment.

Else you could of attaching use your own system to attach detach the terrainblocks, not sure how much work it does to use terrainquads with them.

.obj files are general models, and there is no built in way to convert them to jme’s TerrainQuads.
If you can somehow export a heightmap from the model you built, then you could import that into the terrain.

@Empire Phoenix said: Well the most simple question would be, if you use your whole block, is the remaining performance still good enough? if so just ad a texture with and and be happy that you saved yourself quite some time for the moment.

Else you could of attaching use your own system to attach detach the terrainblocks, not sure how much work it does to use terrainquads with them.


i would think it would be much slower. but im not really familliar enough with it to no for sure.

@Sploreg said: .obj files are general models, and there is no built in way to convert them to jme's TerrainQuads. If you can somehow export a heightmap from the model you built, then you could import that into the terrain.
ah, i thought of the height map idea too. just going into blender, setting the view from the top, and rendering and saving the image. i would then open the image in photoshop or paint.net, make it grayscale, turn up the contrast a little. however, even after using this height map for generating terrain, it would not be completely accurate. id still have to scale, and mess with the height values and everything. it would never be *exactly* how it was in blender. i think what i'll do is take a look at the TerrainQuad class and see if it would be reasonable enough to make my own rendition that would accept .obj files. it will most likely be way too much work, but its worth a shot.

i’ll probably end up just going with the heightmap idea though. its way simpler, and simple is nice.

Creating a heightmap from a blender scene is quite easy and if you do it right it is very accurate too. Just need to know how to do it.
Take a loog at this: Blender documentation to create a heightmap
It is for blender 2.4 tho, so some of the options are at a different place, but the second part of this video pretty much shows you where to find everything you need:
Youtube video explaining heightmap creation