25 ms·
Expressing L-systems in Rust
- xixixao 11y ago> I didn’t really want to write any graphics code, so here’s a way to cheat: I wanted to try out Rust maybe a year ago, was thinking of writing a simple terminal app and found out that there was no way to do simple 2D graphics in Rust. Has the situation changed?
- DizzyDoo 11y agoThere's some nice bindings for SDL that's rather well-maintained: https://github.com/AngryLawyer/rust-sdl2 https://github.com/AngryLawyer/rust-sdl2
- mseri 11y agoThings are moving fast. I'm not sure what you need specifically, but piston[1,2] is probably what to look at and maybe more specifically image[3] or conrod[4] [1]:http://www.piston.rs http://www.piston.rs [2]:http://www.reddit.com/r/rust/comments/28srso/piston_game_engine_notice_on_progress/ http://www.reddit.com/r/rust/comments/28srso/piston_game_eng... [3]:https://github.com/PistonDevelopers/image https://github.com/PistonDevelopers/image [4]:http://blog.piston.rs/2014/08/30/conrod-update/ http://blog.piston.rs/2014/08/30/conrod-update/
- irq-1 11y agoIf you try the piston getting started example on Windows (the spinning square), change the freetype name to "libfreetype.a" and put it in the 1.0 path: C:\Program Files\Rust stable 1.0\bin\rustlib\x86_64-pc-windows-gnu\lib Other than that it works.
- JoshTriplett 11y agoDepends on the 2d graphics you want. There are Rust bindings for GTK+3 if you want a toolkit, or bindings for Cairo if you want raw 2d graphics.
- btown 11y agoJust sent a couple of pull requests to make this run on stable Rust 1.0.0 (using swaps instead of the unstable drain feature), and to clarify that production rules shouldn't be able to mutate their environment (they should be pure functions). Great library, and a good introduction to how Rust's typing can make algorithm implementations a pleasure to read in code! EDIT: Links for the curious: https://github.com/atheriel/lsystem/pull/2 https://github.com/atheriel/lsystem/pull/2 https://github.com/atheriel/lsystem/pull/3 https://github.com/atheriel/lsystem/pull/3
- hansjorg 11y agoVery cool, L-systems are fascinating. As an apropos, there was actually released a Rust implementation of Turtle graphics recently: https://github.com/Kingdread/Rurtle https://github.com/Kingdread/Rurtle