Go 3D Game Engine http://g3n.rocks
Fork from https://github.com/g3n/engine
|
|
7 年 前 | |
|---|---|---|
| animation | 7 年 前 | |
| audio | 7 年 前 | |
| camera | 7 年 前 | |
| core | 7 年 前 | |
| experimental | 7 年 前 | |
| geometry | 7 年 前 | |
| gls | 7 年 前 | |
| graphic | 7 年 前 | |
| gui | 7 年 前 | |
| light | 7 年 前 | |
| loader | 7 年 前 | |
| material | 7 年 前 | |
| math32 | 7 年 前 | |
| renderer | 7 年 前 | |
| text | 7 年 前 | |
| texture | 7 年 前 | |
| tools | 7 年 前 | |
| util | 7 年 前 | |
| window | 7 年 前 | |
| .gitattributes | 7 年 前 | |
| LICENSE | 8 年 前 | |
| README.md | 7 年 前 |

<a href="https://godoc.org/github.com/g3n/engine"><img src="https://godoc.org/github.com/g3n/engine?status.svg" alt="Godoc"></img></a>
<a href="https://goreportcard.com/report/github.com/g3n/engine"><img src="https://goreportcard.com/badge/github.com/g3n/engine" alt="Go Report Card"/></a>
G3N (pronounced "gen") is a cross-platform OpenGL 3D game engine written in Go.
### To see G3N in action try the G3N demo or the Gokoban award winning game.
<img style="float: right;" src="https://raw.githubusercontent.com/g3n/g3nd/master/data/images/g3nd_screenshots.png" alt="G3ND In Action"/>
## Highlighted Projects
Gokoban - 3D Puzzle Game (1st place in the 2017 Gopher Game Jam)
## Dependencies
G3N requires Go 1.8+
The engine requires an OpenGL driver and a GCC-compatible C compiler to be installed.
On Unix-based systems the engine depends on some C libraries that can be installed using the appropriate distribution package manager.
xorg-devlibgl1-mesa-devlibopenal1libopenal-devlibvorbis0alibvorbis-devlibvorbisfile3xorg-x11-devel.x86_64mesa-libGL.x86_64mesa-libGL-devel.x86_64openal-soft.x86_64openal-soft-devel.x86_64libvorbis.x86_64libvorbis-devel.x86_64brew install libvorbis openal-soft## Installation
The following command will download the engine along with all its Go dependencies:
go get -u github.com/g3n/engine/...
## Features
<img style="float: right;" src="https://github.com/g3n/g3n.github.io/raw/master/img/g3n_banner_small.png" alt="G3N Banner"/>
## Hello G3N
The code below is a basic "hello world" application
(hellog3n)
that shows a blue torus.
You can download and install hellog3n via: go get -u github.com/g3n/demos/hellog3n
For more complex demos please see the G3N demo program.
package main
import (
"github.com/g3n/engine/util/application"
"github.com/g3n/engine/geometry"
"github.com/g3n/engine/material"
"github.com/g3n/engine/math32"
"github.com/g3n/engine/graphic"
"github.com/g3n/engine/light"
)
func main() {
app, _ := application.Create(application.Options{
Title: "Hello G3N",
Width: 800,
Height: 600,
})
// Create a blue torus and add it to the scene
geom := geometry.NewTorus(1, .4, 12, 32, math32.Pi*2)
mat := material.NewPhong(math32.NewColor("DarkBlue"))
torusMesh := graphic.NewMesh(geom, mat)
app.Scene().Add(torusMesh)
// Add lights to the scene
ambientLight := light.NewAmbient(&math32.Color{1.0, 1.0, 1.0}, 0.8)
app.Scene().Add(ambientLight)
pointLight := light.NewPoint(&math32.Color{1, 1, 1}, 5.0)
pointLight.SetPosition(1, 0, 2)
app.Scene().Add(pointLight)
// Add an axis helper to the scene
axis := graphic.NewAxisHelper(0.5)
app.Scene().Add(axis)
app.CameraPersp().SetPosition(0, 0, 3)
app.Run()
}
<img style="float: right;" src="https://github.com/g3n/demos/blob/master/hellog3n/screenshot.png" alt="hellog3n Screenshot"/>
## Documentation
For the engine API reference, please see
.
Currently, the best way to learn how to use G3N is to look at the source code of the demos from G3ND. In the future we would like to have a "Getting Started" guide along with tutorials in the wiki.
## Contributing
If you find a bug or create a new feature you are encouraged to send pull requests!
## Community
Join our channel on Gophers Slack (Click here to register for Gophers Slack). It's a great way to have your questions answered quickly by the G3N community.