Skip to content

Latest commit

 

History

History

README.md

Examples

Build

Native:

Build and run an example, in this case the triangle example:

$ cargo run --release --example triangle

WebAssembly:

See web/README.md.

A note on async

All of the examples builds to both native (desktop, mobile or whatever target specified) and WebAssembly (wasm) that can be run in a browser. Because they should run in a browser and to keep the same code for native and wasm, all loading happens async. If your application is native only, you can avoid the async runtime (tokio or async-std) and use three_d_asset::load instead of three_d_asset::load_async.

Triangle [code] [demo]

This is the recommended starting point for a gentle introduction to three-d.

Triangle example

Triangle core [code] [demo]

This is the same as the Triangle example, except it only uses the core module and not the renderer module.

Triangle core example

Shapes2D [code] [demo]

Shapes2d example

Shapes [code] [demo]

Shapes example

Mandelbrot [code] [demo]

Mandelbrot example

Lights [code] [demo]

Lights example

Terrain [code] [demo]

Terrain example

Environment [code] [demo]

Environment example

PBR [code] [demo]

PBR example

Statues [code] [demo]

Statues example

Screen [code] [demo]

Screen example

Text [code] [demo]

Text example

Image [code] [demo]

Image example

Lighting [code] [demo]

Lighting example

Sprites [code] [demo]

Sprites example

Texture [code] [demo]

Texture example

Instanced Shapes [code] [demo]

Instanced Shapes example

Multisample [code] [demo]

Screen example

Picking [code] [demo]

Picking example

Animation [code] [demo]

Animation example

Volume [code] [demo]

Volume example

Point cloud [code] [demo]

Point cloud example

Effect [code] [demo]

Effect example

Particles [code] [demo]

Particles example

Wireframe [code] [demo]

Wireframe example

Imposters [code] [demo]

Imposters example

Instanced Draw Order [code] [demo]

This example shows how depth ordering is currently working for InstancedMesh objects with transparency.

Instanced Draw Order

Normals [code] [demo]

Normals example

Logo [code] [demo]

Logo example

Winit window [code] [demo]

Shows how to easily combine a custom winit window with three-d rendering.

Winit window example

Multiwindow [code] [demo]

Shows how to create multiple winit windows and render with three-d.