Nannou/Rust tutorial based on Schotter by Georg Nees

Related tags

Utilities schotter
Overview

Schotter Four Ways

Schotter (German for gravel) is a piece by computer art pioneer Georg Nees. It consists of a grid of squares 12 across and 22 down with random rotation and displacement that increases towards the bottom.

The original was created using a pen plotter. I don't know if Dr. Nees had access to a graphics terminal (fairly rare at the time) to preview the result or if he ran the program multiple times to get different results before choosing this as the final.

Schotter is fairly simple to code; at least it is today with modern graphics libraries. Several other people have written tutorials for how to code this using various platforms. I'm adding to this collection with a series of tutorials for coding it in Rust using the Nannou library.

This tutorial assumes you are familiar with the Rust language and, if you will be following along (which I certainly encourage), access to a working Rust coding environment. We will be using a Rust "workspace", which allows grouping multiple related programs together. (You can learn more about workspaces in chapters of The Rust Programming Language or The Cargo Book.)

Here are the steps I use for creating a Rust workspace:

  1. Create a new directory for the workspace.

  2. Create a new file named "Cargo.toml" in that directory with the following contents:

    [workspace]
    members=[
    
    ]
    
  3. Optionally initialize configuration management for that directory. I like to use git for this. When I get something I like (and that works), I commit the files in git. Then as I make changes, I can easily compare what I have done to that version, and I can easily revert back to that version if I really mess things up and want to start again. This also makes it easy to publish the result online (for example, on GitHub). There are two steps:

    • Initialize the repository. This can be done with the command line (git init). Alternatively, many editors have a method to do this. For example, in VS Code go to the Source Control view (Ctrl+Shift+G) and click Initialize Repository.

    • Create a file ".gitignore" containing the files that should not be managed by git. For Rust programs there are two:

      /target
      Cargo.lock
      
  4. Optionally create standard information files in the directory:

    • LICENSE.txt, containing the license you want to use. You can pick one from https://choosealicense.com/; I like the permissive MIT license for most of my generative art code. Just copy the license text, paste it into LICENSE.txt, and fill in the copyright information (year and your name).
    • README.md, containing general information about the project in MarkDown format. If you publish it to GitHub, this file will be displayed on the main repository page.

We'll be coding Schotter four different ways, each building on the previous version. Click a link for a short tutorial; they are designed to be done in order. You can find the end result for each tutorial in the appropriate directory.

Schotter1: Use the Nannou "sketch" facility to code a simple version with no frills.

Schotter2: Change the code to a Nannou "app" with persistent data and simple keyboard commands to adjust some parameters.

Schotter3: Add a control panel to make it easier to adjust parameters on the fly.

Schotter4: Animate the squares, so they move from the starting grid to their displaced positions, and from there to new positions.

I may add some variations later; after all, that's what creative coding is all about! They may or may not be accompanied by full tutorials. But that's it for now.

You might also like...
Rust Kubernetes runtime helpers. Based on kube-rs.
Rust Kubernetes runtime helpers. Based on kube-rs.

kubert Rust Kubernetes runtime helpers. Based on kube-rs. Features clap command-line interface support; A basic admin server with /ready and /live pro

A simple quote-based code generator for Rust

flexgen A flexible, yet simple quote-based code generator for creating beautiful Rust code Why? Rust has two types of macros, and they are both very p

A safe `Pin`-based intrusive doubly-linked list in Rust

pin-list This crate provides PinList, a safe Pin-based intrusive doubly linked list. Example A thread-safe unfair async mutex. use pin_project_lite::p

Rust Shop is a fake cloud-based software company that you can fork.

RustShop RustShop is an attempt at building a template and utilities to help quickly set up and manage a production grade cloud-based system. The core

🐝🦀🔥 An ebpf based CPU profiler written in Rust

profile-bee 🐝 🦀 🔥 Profile Bee is an eBPF based CPU profiler written in Rust for performance and efficiency. Aya is used for building the BPF progra

A rust-based mechanical keyboard firmware

rumcake A rust-based mechanical keyboard firmware that aims to be decentralized, featureful, and easy to configure. ⚠ rumcake is still a work in progr

Utilities and tools based around Amazon S3 to provide convenience APIs in a CLI

s3-utils Utilities and tools based around Amazon S3 to provide convenience APIs in a CLI. This tool contains a small set of command line utilities for

A DIY, IMU-based skateboard activity tracker
A DIY, IMU-based skateboard activity tracker

tracksb A DIY, IMU-based skateboard activity tracker. The idea is to come up with algorithms to track activity during skateboarding sessions. A compan

A tiling window manager for Windows 10 based on binary space partitioning
A tiling window manager for Windows 10 based on binary space partitioning

yatta BSP Tiling Window Manager for Windows 10 Getting Started This project is still heavily under development and there are no prebuilt binaries avai

Owner
null
Full tutorial on coding AI function calling in Rust programming by [Jeremy Chone](https://youtube.com/jeremychone)

Full tutorial on coding AI function calling in Rust programming by Jeremy Chone. We will be using the OpenAI API, but similar approaches can be applie

null 14 May 26, 2024
This is a small demo to accompany the Tauri + Yew tutorial

Tauri + Yew Demo This is a small demo to accompany the Tauri + Yew tutorial

Steve Pryde 94 Jan 2, 2023
Demo provider, source code for the Provider tutorial.

Fiberplane "Catnip" (tutorial) provider This repository contains the final code of the provider built within the "Create a Provider" tutorial. It reli

Fiberplane 4 Feb 15, 2023
A high level diffing library for rust based on diffs

Similar: A Diffing Library Similar is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it.

Armin Ronacher 617 Dec 30, 2022
🦀 Rust-based implementation of a Snowflake Generator which communicates using gRPC

Clawflake Clawflake is a Rust application which implements Twitter Snowflakes and communicates using gRPC. Snowflake ID numbers are 63 bits integers s

n1c00o 5 Oct 31, 2022
Easy to use Rust i18n library based on code generation

rosetta-i18n rosetta-i18n is an easy-to-use and opinionated Rust internationalization (i18n) library powered by code generation. rosetta_i18n::include

null 38 Dec 18, 2022
A Rust-based tool to analyze an application's heap.

Heap analysis tool for Rust Heap analysis is a pure-Rust implementation to track memory allocations on the heap. Usage Heap analysis provides a custom

Moritz Hoffmann 8 May 9, 2022
CBOR (binary JSON) for Rust with automatic type based decoding and encoding.

THIS PROJECT IS UNMAINTAINED. USE serde_cbor INSTEAD. This crate provides an implementation of RFC 7049, which specifies Concise Binary Object Represe

Andrew Gallant 121 Dec 27, 2022
A rust-based version of the popular dnsgen python utility

ripgen A rust-based version of the popular dnsgen python utility. ripgen is split into two main parts: ripgen: A CLI utility that calls into ripgen_li

resync 198 Jan 2, 2023
tracing - a framework for instrumenting Rust programs to collect structured, event-based diagnostic information

tracing-appender Writers for logging events and spans Documentation | Chat Overview tracing is a framework for instrumenting Rust programs to collect

Cris Liao 1 Mar 9, 2022