L3DT users' wiki
Large 3D terrain generator


Plugin information

Authors Aaron and Tillot
Description Applies a spherical distortion to a heightfield and water map.
Menu option 'Extensions→SphericalDistort'
Download link SphericalDistort-bin.zip
Source code Over here

What does it do?

A picture tells a thousand words, so here's three thousand:

Before After (pos. radius) After (neg. radius)
Before distortion Positive radius Negative radius

As you can see, SphericalDistort distorts the heightfield as if it were on a sphere.

This plugin, and L3DT in general, cannot produce complete spherical worlds. This is due to some topological differences between planes and spheres.

Using SphericalDistort

When you select the 'Extensions→SphericalDistort→Apply spherical distortion' option, you will be asked to enter the sphere radius, which is measured in kilometres. Regarding the radius:

  • The default value is the radius of Earth (6400km).
  • A negative value will create an inner-sphere effect, or can be used to un-do a positive distortion.
  • You should not use radii smaller in magnitude than about 4x the largest side-length of your map, as heightfields tend to look a bit silly when tilted too far (see screenshots above).

Extended clipping options (by Tillot)

I hacked the source for the SphericalDistort plugin to allow for limiting the curvature in the x,y, or at some specified radius. This allows for 'pieces' of a sphere to be generated kind of like a cookie cutter. The option is available using the 'Extensions→SphericalDistort→Apply spherical distortion (extended options)' menu option.

Here's the heightmap:


Here's a terrain screenshot:


This plugin doesn't currently allow removing the surrounding terrain edges, but will some day (see to-do list).

If the terrain is converted into a poly mesh it would then be as simple as using poly editing tool like Maya, Max, Lightwave, or Blender to cut out the pieces and stitch them together into a sphere.

To-do list

  • Run in L3DT's worker thread.
  • Make last used settings persistent.
  • Export clipped area.
  • Set MAPFLAG_INVALID for TN, LM and TX (if UseLM enabled).



  • Changed function arguments to VarID_hvars from VarID_maps.
  • Updated to Zeolite v2.7.1.


  • Added support for 'undo'.


  • Fixed fault with variable renaming in extended version.


  • Changed to include Tillot's modifications.


  • Changed radius from metres to kilometres.
  • Distort the water map too.
  • Updated MAPFLAG_MODIFIED for HF & WM, so maps are saved after distortion.
  • Released with L3DT v2.4b build 5.


  • Released.
plugins/calc/sphericaldistort.txt · Last modified: 2017/08/31 05:11 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki