Skip to content
Snippets Groups Projects
Commit c36235df authored by Finn Bear's avatar Finn Bear
Browse files

WIP.

parent 7216b0a4
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ use crate::slide::s2_introduction::Introduction;
use crate::slide::s3_complexity::Complexity;
use crate::slide::s4_automata::Automata;
use crate::slide::s5_fractals::Fractals;
use crate::slide::s6_computation::Computation;
use crate::slide::Slide;
use eframe::egui::style::Margin;
use eframe::egui::{Key, Style, TextStyle, Visuals};
......@@ -60,6 +61,7 @@ fn create_slides() -> Vec<Box<dyn Slide>> {
Box::new(Complexity::default()),
Box::new(Automata::default()),
Box::new(Fractals::default()),
Box::new(Computation::default()),
]
}
......
......@@ -5,6 +5,7 @@ pub mod s2_introduction;
pub mod s3_complexity;
pub mod s4_automata;
pub mod s5_fractals;
pub mod s6_computation;
pub trait Slide {
fn show(&mut self, ui: &mut Ui, ctx: &Context);
......
......@@ -38,10 +38,11 @@ impl Slide for Title {
.title_bar(false)
.resizable(false)
.anchor(Align2::CENTER_CENTER, Vec2::ZERO)
.default_width(400.0)
.show(ctx, |ui| {
ui.vertical_centered(|ui| {
ui.heading("Generative Art");
ui.label("By: TODO");
ui.label("By: Finn, Matthew, Nathan, Owen");
});
});
}
......
......@@ -17,24 +17,20 @@ impl Default for Fractals {
code.code = String::from(
r###"
fn mandelbrot(x0, y0) -> color {
MAX := 512
x := 0.0;
y := 0.0;
i := 0;
fn mandelbrot(x0, y0) -> bool {
MAX = 512
x = 0.0
y = 0.0
i = 0
while x^2 + y^2 <= 4 and i < MAX {
x_temp := x^2 - y^2 + x0
x_temp = x^2 - y^2 + x0
y = 2.0 * x * y + y0
x = x_temp
i += 1
}
if i == MAX {
return black;
} else {
return white;
}
return i == MAX
}
"###,
);
......
use crate::egui::{Context, Frame, Ui};
use crate::Slide;
use eframe::egui::style::Margin;
#[derive(Default)]
pub struct Computation {}
impl Slide for Computation {
fn show(&mut self, ui: &mut Ui, _ctx: &Context) {
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
ui.heading("More Computation-based Art");
ui.add_space(8.0);
ui.label(" ⏵ Raytracing");
ui.label(" ⏵ Raymarching");
ui.label(" ⏵ Particle simulations");
ui.label(" ⏵ Fluid simulations");
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment