Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zacharycarter/zengine
2D | 3D Game development library
https://github.com/zacharycarter/zengine
2d 3d game-development game-engine nim
Last synced: 2 months ago
JSON representation
2D | 3D Game development library
- Host: GitHub
- URL: https://github.com/zacharycarter/zengine
- Owner: zacharycarter
- Archived: true
- Created: 2017-07-08T15:06:59.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-03T21:29:50.000Z (almost 7 years ago)
- Last Synced: 2024-02-06T03:08:51.153Z (5 months ago)
- Topics: 2d, 3d, game-development, game-engine, nim
- Language: Nim
- Homepage:
- Size: 58.5 MB
- Stars: 154
- Watchers: 9
- Forks: 13
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Lists
- awesome-nim - zengine - 2D | 3D Game development library. (Game Development / Byte Size)
README
# zengine
2D | 3D Game development libraryNOTE - Please run examples from root directory for now
Progress -
![3D Skeletal Animation](https://media.giphy.com/media/l1J3tQly5PfRKtMUo/giphy.gif)
![Lit Model](http://i.imgur.com/YIQutvx.png)
![Model Loading](http://i.imgur.com/fKbrXPi.png)
![FPS Camera](https://media.giphy.com/media/xUA7aSrJzGLbB0x5hS/giphy.gif)
![2D & 3D Primitive Rendering](http://i.imgur.com/m5gWahM.png)Dependencies:
[Assimp](https://github.com/assimp/assimp)```nim
import zengine, sdl2, opengltype
LightKind = enum
Point, Directional, Spot
Light = ref object
id: int
enabled: bool
kind: LightKind
position: Vector3
target: Vector3
radius: float
diffuse: ZColor
intensity: float
coneAngle: floatconst
WIDTH = 960
HEIGHT = 540
MAX_LIGHTS = 8var lights: array[MAX_LIGHTS, Light]
var lightsCount = 0
var lightsLocs: array[MAX_LIGHTS, array[8, int]]proc createLight(kind: LightKind, position: Vector3, diffuse: ZColor): Light =
result = nilif lightsCount < MAX_LIGHTS:
result = Light(
id: lightsCount,
kind: kind,
enabled: true,
position: position,
target: vectorZero(),
intensity: 1.0,
diffuse: diffuse
)lights[lightsCount] = result
inc(lightsCount)
else:
result = lights[lightsCount]proc setShaderLightsValues(shader: Shader) =
var tempInt: array[8, GLint]
var tempFloat: array[8, GLfloat]for i in 0..