The world map is best generated XYZ, a cube-sphere for what I ultimately have in mind, but a long/lat rectangle mapped to a UV sphere is something I have done many times before. I don't have a noise function in plain vanilla javascript but I can do midpoint displacement (diamond square) by long and lat for a nice height map of the long/lat points, divide the long/lat quads into triangles and average the vertices to find a height for each triangle, placing it above or below sea level.
Drawing landmass... this is just a polygon drawn around an origin from a random starting angle to a random stopping angle. The rectangle is 520 by 260 pixels because the blog text block seems to be that wide and this looks okay. The star sector was 500 pixels square, a 20 light year cube with about 30 stars.
No comments:
Post a Comment