rename to subtitled1

main
annieversary 2021-08-17 16:25:34 +02:00
parent 71b1322869
commit 466cbb2869
5 changed files with 27 additions and 12 deletions

16
Cargo.lock generated
View File

@ -2295,14 +2295,6 @@ dependencies = [
"smithay-client-toolkit 0.6.6",
]
[[package]]
name = "spircles"
version = "0.1.0"
dependencies = [
"nannou",
"utils",
]
[[package]]
name = "spirv_cross"
version = "0.23.1"
@ -2348,6 +2340,14 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
[[package]]
name = "subtitled1"
version = "0.1.0"
dependencies = [
"nannou",
"utils",
]
[[package]]
name = "syn"
version = "1.0.74"

View File

@ -4,4 +4,4 @@ this is a bunch of nannou projects
## list
- spircles: some spinning circles
- subtitled #1: some spinning circles

View File

@ -1,5 +1,5 @@
[package]
name = "spircles"
name = "subtitled1"
version = "0.1.0"
edition = "2018"

View File

@ -1,7 +1,6 @@
use nannou::prelude::*;
use utils::color::color;
use utils::record::record;
fn main() {
nannou::app(model).update(update).simple_window(view).run();
@ -77,5 +76,5 @@ fn view(app: &App, _model: &Model, frame: Frame) {
draw.to_frame(app, &frame).unwrap();
record(app, &frame);
utils::record::record(app, &frame);
}

View File

@ -1,2 +1,18 @@
pub mod color;
pub mod record;
use nannou::prelude::*;
/// Maps the sine of v to (out_min, out_max)
pub fn map_sin(v: f32, out_min: f32, out_max: f32) -> f32 {
map_range(v.sin(), -1.0, 1.0, out_min, out_max)
}
pub trait Vec2Extension {
fn atan2(self) -> f32;
}
impl Vec2Extension for Vec2 {
fn atan2(self) -> f32 {
self.x.atan2(self.y)
}
}