Skip to content

Latest commit

 

History

History

examples

Examples

The triangle examples demonstrate initialization and basic event handling, where as the remaining examples use a common framework to manage these tasks. The examples framework has the following camera controls:

Camera Controls

Key Movement
W, S, A, D Forward, Backward, Strafe-Left, Strafe-Right
PageUp, PageDown Up, Down; (Hold Shift to preserve the focus point)
C Set the camera's focus point at the origin
F11 Toggle fullscreen
Mouse-Click-Drag Rotate the camera around the focus point
Mouse-Scroll Move the camera toward or away from the focus point

triangle.rs

triangle.rs

triangle_multisample.rs

triangle_multisample.rs

cube.rs

cube.rs

cube_texture.rs

cube_texture.rs

particle_simulator.rs

Additional Controls

Key Action
F2 Reset position and velocity values
F3 Reset position values

particle_simulator.rs

gltf_viewer.rs

Sample models can be found here:

https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0

Usage

Note that compile optimizations greatly impact the performance of glTF file loading. Using release mode is recommended.

cargo run --release --example gltf_viewer <FILE>

Features

  • Image Based Lighting (IBL)
  • Physically Based Rendering
  • Animation
  • Morph Targets (maximum of 2)

Additional Controls

Key Action
1 - 9 Toggle animation channel

Examples

Note that the examples will look rather dark until IBL is implemented.

gltf_viewer.rs

gltf_viewer.rs