Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schwalbe-t/obem
A Gera library for 3D browser games.
https://github.com/schwalbe-t/obem
3d-audio 3d-games 3d-graphics game-dev game-development game-framework game-library games
Last synced: 3 days ago
JSON representation
A Gera library for 3D browser games.
- Host: GitHub
- URL: https://github.com/schwalbe-t/obem
- Owner: schwalbe-t
- License: mit
- Created: 2024-01-14T17:44:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-25T10:45:02.000Z (8 months ago)
- Last Synced: 2025-01-21T07:43:27.696Z (12 days ago)
- Topics: 3d-audio, 3d-games, 3d-graphics, game-dev, game-development, game-framework, game-library, games
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Obem
*A Gera library for 3D browser games.*This library aims provides simple and easy-to-use bindings for WebGL and the Web Audio API for games written in [the Gera programming language](https://github.com/geralang).
### Example
Below is a simple triangle example, and what it looks like when viewed in a web browser:
```
mod exampleuse obem::gfx::(Mesh, Shader, Surface)
proc main() {
obem::on_init(start)
}proc start() {
var triangle = Mesh::new([
-0.5, -0.5, 0.0, 1.0, 0.2, 0.2,
0.0, 0.5, 0.0, 0.2, 1.0, 0.2,
0.5, -0.5, 0.0, 0.2, 0.2, 1.0
], [0, 1, 2])
var shader = Shader::new("
attribute vec3 coords;
attribute vec3 color;
varying vec3 fcolor;void main(void) {
gl_Position = vec4(coords, 1.0);
fcolor = color;
}
", "
precision highp float;
varying vec3 fcolor;
void main(void) {
gl_FragColor = vec4(fcolor, 1.0);
}
")
obem::on_frame(|| {
Surface::main()
.> clear_color(1.0, 1.0, 1.0, 1.0)
.> draw_mesh(triangle, [3, 3], shader, false)
})
}
```
```html
Obem Example
```
![Output Screenshot](triangle.png)