Height2Lua - Heightmaps to terrain!

Hi,

I just created this heightmap to triangle terrain software and script and I thought I’d share it with you.
The images are dropped in a software that I wrote.
The software converts the image to a table with values from 0-1.
Then my Roblox script will convert that table into a terrain.

Very simple to use, here’s a tutorial anyways:

Model:

Software:

2 Likes

Your Java program doesn’t work for me. It just freezes.
I’m using the latest Java, Windows 7.

How big image did you drop? Droping 200+ pixel image is not suggested.

1 Like

640x640 :confused: Tried with 60ish and it worked. Going to get some more computing power to get a 1024x1024-ish converted :slight_smile:

Can I port this over into a windows executable?

http://lmgtfy.com/?q=jar+to+exe :p?

It would be better to let a programmer do it, plus it’s good practice for me. :wink:

I remember when I made something like that I had to have it skip every few pixels because otherwise I got a 40 mb+ text file. XD MapGen - Roblox link for the pre generated map if anyone is curious. Used C++ in order to transfer from the heightmap to text. I had it working for upto 2k+ size images I think. [EDIT] So I just spent awhile looking and I couldn’t find an even remotely working version but I did find out that I used opencv in order to go through the image. So I leave that in someone hand’s who is smarter than me. :smiley:

Yea I don’t think I’ll expand it to take major images. Reason being that the resolution of the terrain usually doesn’t have to be so large. It works fine on 100x100 Images, and I don’t think people would need higher resolution on their terrain. Besides, people who knows how to handle these scripts knows how to shrink an image so I dont have to implement a “skip certain amount of pixels” approach.

If they just need larger maps, then that is regulated in the lua script anyways so it doesn’t depend on the image size.

I made a Python program that does this, and using a scaling technique it can support some pretty large files. What I did was have it generate a .lua file in a folder, and after it reaches a certain size, it creates a new one, and each of these are set up like a ModuleScript. Once completed, I import them into Roblox, and just require the chunks to load the terrain.

Using a program called World Machine, I created a heightmap that was 512x512 pixels. Using my program I split it into 64 (8 by 8 ) modules that each covered a square on the map. What I did for one of my projects is have the client procedurally generate the terrain as it approaches, making it manageable to support a massive map of around 30,000x30,000 studs.

I don’t have any images at the moment to show how it works, but if your computer can handle my unoptimized procedural forest generator and non-streamed buildings, go here.