-
Notifications
You must be signed in to change notification settings - Fork 2
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.
- Make sure you save to a new PNG after each step. Once you close Wilbur you will be unable to revert your actions.
- 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.
- Since a baseplate is 640 LDUs large, the total size of the terrain in LDUs should be 640 multiplied by the dimensions in pixels.
- 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).
- 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.
- 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.
- 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
- Import the OBJ file into MeshLab.
- 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".
- Export from MeshLab as an STL file.
- 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}}}
- Run the LDR file through my "terrain_stepper.js" tool to clean up the mesh and "snap" the coordinates to standard LDraw dimensions.