A 3D math playground visualizing on a canvas trait which the user needs to implement e.g. using XCB or a HTML5 Canvas for drawing as WebAssembly application. (Both exists in separate projects.)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Georg Hopp 76a30a5e3d
npm init wasm-app www
6 years ago
branches First examples from rust book 6 years ago
fractional fix construction of tetrahedron 6 years ago
functions First examples from rust book 6 years ago
guessing_game First examples from rust book 6 years ago
hello First examples from rust book 6 years ago
loops First examples from rust book 6 years ago
ownership First examples from rust book 6 years ago
rectangles Add rectangles example 6 years ago
recursion Add recursion example 6 years ago
restaurant Organize modules in new source files 6 years ago
tutorial/wasm-game-of-life npm init wasm-app www 6 years ago
variables First examples from rust book 6 years ago
wasm-game-of-life Add prepared wasm example 6 years ago
xcb-test Add some xcb examples. 6 years ago
.gitignore Also exclude Cargo.lock from vcs 6 years ago
README.md Add a readme file 6 years ago
interesting.md Add links to information about transformations 6 years ago

README.md

Rust playground

Things I have recently done while learning the Rust programming language.

Synopsis

Change in one of the toplevel subdirectories and try cargo build or cargo run. Maybe not everything is working oob. Feel free to fix whatever you want.

Description

Various small examples I have tried while learning rust. The biggest and currently most active project is fractional which started as an implamentation of a rational number data type and then switched to a 3D math playground visualizing using XCB (in future it might also use a HTML5 Canvas for drawing as WebAssembly application. Using fractions with 3D math has several drawbacks:

  1. A huge part of 3D math is non rational, like sin, cos, tan and sqrt.
  2. The numerator and denominator tend to become very huge while nearing to non rational numbers and reduction is difficult and time consuming.
  3. Because of 2 it is way slower than the floating point calculation (at least with a decent coprocessor).

Anyway, implementing the vector math stuff for both fractions and floating point was a nice playground for generics and traits. In future I might add another data type which implements the math as done by David Braben for the elite computer game.

Requirements

Always

  • A recent version of the Rust programming language as well as tooling. Currently I use Rust 1.39.0.

For fractional

  • A running X Server with XCB and X11-SHM extentions

Dependencies

...

Contributing

Feel free to make pull requests as you like, no guarantee that the will be added.

License

Copyright © 2020 Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author

Georg Hopp georg@steffers.org