OGLdev is a very nice serise of tutorials that introduces basic knowledge for writing a OpenGL program. The original tutorials are written in C. However, I want to reproduce the same results in Rust for fun and learning. So that is why I created this repository.
I used glium to use OpenGL in Rust. It is quite different from the one used by the original tutorials. You may see lots of difference (including variable names, function calls... etc.) between those tutorials and my implementations. Just stay calm. Take some time to read carefully. You will find that they are basically the same. At least they try to archive the same goals.
The documents of glium will be very useful when you dig my code.
The titles below summarize the goals of the tutorials on OGLdev. Each of them links to a Rust implementation of the corresponding tutorial.
- This one does not have too much difference from the 2nd and 3rd tutorial since I have used shader programs in those tutorials.
- To Use Uniform Variables
- To Perform Translation Transformation
- To Perform Rotation Transformation
- To Perform Scaling Transformation
- To Interpolate Color inside a Triangle
- To Draw with A Index Buffer
- To Concatenate Transformations
- To Perform Perspective Projection
- To Perform View Transformation
- To Move The Camera Using Arrow Keys On The Keyboard
- To Move The Camera Using Both The Keyboard And The Mouse
- To Draw with Textures
- There is lots of difference between this one and the original tutorial, because
glium
does many great jobs in Rust and we just need to add a few code to make the same effect.
This command should build the whole project and run the n
-th tutorial:
> cargo run --bin tutorial_n
For example, to run the first tutorial:
> cargo run --bin tutorial_01