three-d

What is it?

A 3D renderer which enables out-of-the-box build to both desktop (Rust + OpenGL) and web (Rust to WebAssembly using wasm-bindgen + WebGL2 bindings provided by the web-sys crate). This means you can develop a 3D application on desktop and easily deploy it on web!

Supported browsers

Chrome, Firefox, Edge and Safari (Safari requires enabling the "WebGL 2.0" experimental feature).

Examples

https://asny.github.io/three-d/

Lighting example Spider example

Main features

Build

Desktop:

Build and run an example, in this case 'hello_world': console $ cargo run --example hello_world --release

Web:

Build and generate web output (webassembly, javascript and html files) into the pkg folder: console $ wasm-pack build examples/hello_world --target web --out-name web --out-dir ../../pkg Install a server that properly defines the application/wasm mime type for example: console $ npm install -g http-server Start the server and go to http://localhost:8080 in a browser: console $ http-server

Desktop and Web:

Build and run an example on desktop and also generate web output (webassembly, javascript and html files) into the pkg folder: console $ ./examples/hello_world/run

Other:

Feature requests and bug reports are more than welcome, just open an issue. Contributions are highly appreciated, please feel free to reach out to me or simply create a pull request.