Skip to content

Heightfields with Wilbur

Michael Horvath edited this page Dec 26, 2020 · 1 revision

These are some outdated notes on how I generated heightfields using Wilbur and imported them into LDraw using 3DWin.

Wilbur

  1. Make sure you save to a new PNG after each step. Once you close Wilbur you will be unable to revert your actions.
  2. For the heightfield, I've found that a scale of 1 pixel = 1 baseplate works OK. In the "Surface > Size..." dialog specify the dimensions in pixels you want the heightfield to be. E.g. 128x128 pixels or 128x128 baseplates.
  3. Since a baseplate is 640 LDUs large, the total size of the terrain in LDUs should be 640 multiplied by the dimensions in pixels.
  4. Enter this information into the "Surface > Map Info..." dialog, except center things properly in such a way that it extends by half the amount in the positive direction and half in the negative direction. E.g. -40960, +40960 (128*640/2).
  5. To generate a very basic random texture, select "Filter > Calculate Height Field...". A pop-up menu will appear. Make sure to un-check the box labeled "Spherical Evaluation". Refer to the official Wilbur tutorials for additional tips on generating a nice heightfield.
  6. Select "Filter > Mathematical > Span..." and enter the height (or range of heights) in LDU you want the heightfield to be. E.g. 0, +15360 (24*640). Otherwise the heightfield will be way too tall.
  7. Make sure you are running Wilbur 1.62.00.00 when exporting as Wavefront OBJ. The OBJ exporter is broken in the latest version 1.83.00.00.

129x129px -40960, -40960, +41600, +41600 0, +15360

MeshLab

  1. Import the OBJ file into MeshLab.
  2. In MeshLab select "Filters" > "Normals, Curvatures and Orientation" > "Transform: Rotate". Set the Rotation angle to 90 degrees around the x-axis and click "Apply" then "Close".
  3. Export from MeshLab as an STL file.
  4. Using the command prompt or a batch file convert the STL file to LDR using "stl2dat.exe". An example of the command line looks like this: {{{stl2dat meshlab_output.stl -ldr -raw}}}
  5. Run the LDR file through my "terrain_stepper.js" tool to clean up the mesh and "snap" the coordinates to standard LDraw dimensions.

Clone this wiki locally