RDGL

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2021 License: LGPL-3.0 Imports: 5 Imported by: 0

README

result-bg2

RDGL - Realistic procedural DEM generation library

DEM : Digital Elevation Model

Features

RDGL can generate procedural terrains, including...

  • Plain
  • Valley
  • Rias coast
  • Continental shelf
  • Mountain range
    ... and so on.
Random DEM generation
Seed = 8 Seed=14
LandProportion01=1.0
Seed = 14
LandProportion01=0.15
Seed = 2022

[*] 1000x1000 (km2) terrain

package main
import output "github.com/TadaTeruki/RDGL/Output"
import rdg "github.com/TadaTeruki/RDGL"

func main(){
  rdg.EnableProcessLog()
  var seed int64 = 14
  dem := rdg.NewDEM(seed)
  dem.Generate()
  output.WriteDEMtoPNGwithShadow("result.png", &dem, 300, -1, output.DefaultShadow(&dem))
  // details : examples/hello_dem.go, examples/hello_dem_detailed.go, examples/write_to_png_with_shadow.go
}

Outline interpolation (Preparing)
examples/resources/draft.png examples/resources/swan.png



TXT/PNG/OBJ output
PNG OBJ (3D model) [*1] [*2]

[*1] displayed with https://github.com/RBFraphael/meshviewer
[*2] Elevation = x50

...
func main(){
  ...
  output.WriteDEMtoTXT("result.txt", &dem, 1000, -1)
  output.WriteDEMtoPNG("result.png", &dem, 300, -1)
  output.WriteDEMtoPNGwithShadow("result1.png", &dem, 300, -1, output.DefaultShadow(&dem))
  output.WriteDEMtoOBJ("result.obj", &dem, 100, -1, 5.0, false)
  // details : examples/write_to_txt.go, examples/write_to_png.go,
  //           examples/write_to_png_with_shadow.go, examples/write_to_obj.go
}

Installation

$ go get github.com/TadaTeruki/RDGL

Author & Contributors

Author : Tada Teruki < tadateruki.public@gmail.com >

Copyright (c) 2021 Tada Teruki

result

Documentation

Index

Constants

View Source
const ARTO_ERROR_1 = "<RDGL> Error : The coodinate assigned to 'GetElevationByKmPoint' is outside of the DEM"

Variables

This section is empty.

Functions

func EnableProcessLog

func EnableProcessLog()

Types

type DEM

type DEM struct {
	Seed               int64
	ElevationAbsM      float64
	LevelingElevationM float64
	UnitKm             float64
	VerticalKm         float64
	HorizontalKm       float64
	Quality01          float64
	LandProportion01   float64
	PlateSizeKm        float64
	// contains filtered or unexported fields
}

func NewDEM

func NewDEM(seed int64) DEM

func (*DEM) Generate

func (dem *DEM) Generate()

func (*DEM) GetElevationByKmPoint

func (dem *DEM) GetElevationByKmPoint(xKm, yKm float64) (float64, error)

func (*DEM) GetLocalTerrain added in v0.1.0

func (dem *DEM) GetLocalTerrain() terrain.LocalTerrainObject

only for development use

func (*DEM) Interpolate

func (dem *DEM) Interpolate(file string)

Directories

Path Synopsis
github.com/TadaTeruki/RDGL/PriorityQueue/priority_queue.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
github.com/TadaTeruki/RDGL/PriorityQueue/priority_queue.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
github.com/TadaTeruki/RDGL/TerrainGeneration/elevation.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
github.com/TadaTeruki/RDGL/TerrainGeneration/elevation.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
github.com/TadaTeruki/RDGL/Utility/utility.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
github.com/TadaTeruki/RDGL/Utility/utility.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
examples/hello_dem.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
examples/hello_dem.go Copyright (C) 2021 Tada Teruki This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL