Heightmapped-Terrain
所属分类:代码编辑器
开发工具:C
文件大小:1307KB
下载次数:0
上传日期:2017-09-24 20:14:25
上 传 者:
sh-1993
说明: 一个简单的高度映射地形查看器和编辑器。练习游戏工具编程的个人辅助项目
(A simple heightmapped terrain viewer and editor. Personal side-project to practice game tool programming)
文件列表:
Camera3D.h (4163, 2017-09-25)
DebugDrawing.h (3573, 2017-09-25)
Editor.h (8092, 2017-09-25)
GameMaths.h (31014, 2017-09-25)
Input.h (4619, 2017-09-25)
Makefile (2583, 2017-09-25)
Meshes (0, 2017-09-25)
Meshes\cube.obj (504, 2017-09-25)
Player.h (7546, 2017-09-25)
Screenshots (0, 2017-09-25)
Screenshots\HeightmappedTerrainScreenshot1.png (1193896, 2017-09-25)
Shader.h (5660, 2017-09-25)
Shaders (0, 2017-09-25)
Shaders\Heightmap.frag (245, 2017-09-25)
Shaders\Heightmap.vert (176, 2017-09-25)
Shaders\MVP.vert (216, 2017-09-25)
Shaders\uniform_colour.frag (224, 2017-09-25)
Terrain.h (14932, 2017-09-25)
gl_lite.h (9468, 2017-09-25)
include (0, 2017-09-25)
include\GLFW (0, 2017-09-25)
include\GLFW\glfw3.h (152470, 2017-09-25)
include\GLFW\glfw3native.h (13594, 2017-09-25)
init_gl.h (3250, 2017-09-25)
libs (0, 2017-09-25)
libs\osx_64 (0, 2017-09-25)
libs\osx_64\libglfw3.a (190120, 2017-09-25)
libs\win32 (0, 2017-09-25)
libs\win32\libglfw3.a (143680, 2017-09-25)
load_obj.h (30221, 2017-09-25)
main.cpp (7300, 2017-09-25)
terrain.pgm (4198, 2017-09-25)
# Heightmapped-Terrain
This is my heightmapped terrain viewer and editor, written in C-style C++ (I've seen it called [Nominal C++](http://archive.is/2016.08.07-162105/https://namandixit.github.io/blog/nominal-c++/), [Orthodox C++](https://gist.github.com/bkaradzic/2e3***96bc7d8c34e042b), C++--).
[Demo video on Youtube](https://youtu.be/FGm2a1pxgsE)
I started it as a personal side-project to practice game/tool programming. It is very much a work in progress; there's isn't a proper UI yet, everything is done with hotkeys, a good few features are missing. Improved usability is on the roadmap!
[![Screenshot of an example level](https://github.com/kevinmoran/Heightmapped-Terrain/blob/master/Screenshots/HeightmappedTerrainScreenshot1.png)](https://youtu.be/FGm2a1pxgsE)
## Building ##
This project is built using a Makefile. Run `make` with MinGW installed to build on Windows. It should also compile on Mac (again just run `make`), but I don't currently have an OSX machine so I can't regularly check.
## Features ##
* Loads heightmap from a .pgm image file
* Can add/remove height from terrain by clicking left/right mouse
* Can run around on the terrain as a cube
* Can save edited height data to the .pgm file
* Can render wireframe of level
* Can reload shaders while program is running
* DebugDrawing functions to visualise points and vectors in an Immediate-Mode fashion
* An extremely lightweight OpenGL function loader based on [Apoorva Joshi](https://twitter.com/ApoorvaJ)'s used in [Papaya](https://github.com/ApoorvaJ/Papaya) (Link to his article is at the top of gl_lite.h
* A custom single-header Wavefront .obj mesh loader I wrote (load_obj.h)
## Dependencies ##
The wonderful [GLFW library](http://glfw.org).
## Controls ##
Here are the current controls for the editor. These are definitely not final and not very user-friendly at the moment, sorry!
### Edit Mode ###
| Key | Action |
| ------------- |:-------------:|
| `W`,`A`,`S`,`D`| Move Camera Forward, Left, Backward and Right |
| `Q`, `E` | Lower/Raise Camera |
| `Arrow Keys` / `Move Mouse` | Turn Camera |
|`M` | Toggle Mouse/Arrow controls for Camera |
|`Left Click`, `Right Click` | Raise/Lower terrain |
| `Number keys` | Choose brush (paint, flatten) |
### Play Mode ###
| Key | Action |
| ------------- |:-------------:|
| `W`,`A`,`S`,`D`| Move Player Forward, Left, Backward and Right |
|`Spacebar` | Jump |
### General (Both Modes) ###
| Key | Action |
| ------------- |:-------------:|
| `Ctrl`+`S` | Save edited terrain to .pgm file |
| `Ctrl`+`R` | Reload shaders |
| `Ctrl`+`F` | Toggle Fullscreen |
| `Tab` | Toggle Edit/Play Mode |
| `/` | Toggle Wireframe view
| `Esc` | Exit program |
近期下载者:
相关文件:
收藏者: