Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
generative_art_cartoon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Finn Bear
generative_art_cartoon
Commits
2480cacc
Commit
2480cacc
authored
2 years ago
by
Finn Bear
Browse files
Options
Downloads
Patches
Plain Diff
Revisions to fractal and conclusion slides.
parent
584fc9aa
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/slide/s10_conclusion.rs
+1
-1
1 addition, 1 deletion
src/slide/s10_conclusion.rs
src/slide/s4_automata.rs
+6
-1
6 additions, 1 deletion
src/slide/s4_automata.rs
src/slide/s6_fractals.rs
+7
-2
7 additions, 2 deletions
src/slide/s6_fractals.rs
with
14 additions
and
4 deletions
src/slide/s10_conclusion.rs
+
1
−
1
View file @
2480cacc
...
@@ -71,7 +71,7 @@ impl Slide for Conclusion {
...
@@ -71,7 +71,7 @@ impl Slide for Conclusion {
name
:
"slides"
,
name
:
"slides"
,
position
:
WindowPosition
::
FromCenter
(
Vec2
::
new
(
0.0
,
ui
.available_height
()
*
0.08
)),
position
:
WindowPosition
::
FromCenter
(
Vec2
::
new
(
0.0
,
ui
.available_height
()
*
0.08
)),
size
:
Vec2
::
new
(
ui
.available_width
()
*
0.95
,
ui
.available_height
()
*
0.85
),
size
:
Vec2
::
new
(
ui
.available_width
()
*
0.95
,
ui
.available_height
()
*
0.85
),
scroll
:
Some
((
elapsed
*
64
.0
)
.min
(
1065.0
)),
scroll
:
Some
((
elapsed
*
90.0
+
350
.0
)
.min
(
1065.0
)),
background
:
Color32
::
TRANSPARENT
,
background
:
Color32
::
TRANSPARENT
,
alpha
:
get_style_alpha
(
ui
.style
()),
alpha
:
get_style_alpha
(
ui
.style
()),
code
:
String
::
from
(
include_str!
(
"../cartoon.rs"
)),
code
:
String
::
from
(
include_str!
(
"../cartoon.rs"
)),
...
...
This diff is collapsed.
Click to expand it.
src/slide/s4_automata.rs
+
6
−
1
View file @
2480cacc
...
@@ -251,7 +251,12 @@ impl Slide for Automata {
...
@@ -251,7 +251,12 @@ impl Slide for Automata {
/// Run one iteration of Conway's Game of Life on the grid, producing a new grid.
/// Run one iteration of Conway's Game of Life on the grid, producing a new grid.
///
///
/// A non-zero expansion parameter expands the grid on each side by that many squares.
/// A non-zero expansion parameter expands the grid on each side by that many squares.
fn
conways_game_of_life
(
grid
:
&
Grid
,
expansion
:
usize
,
alive_color
:
Color32
,
fade
:
bool
)
->
Grid
{
pub
fn
conways_game_of_life
(
grid
:
&
Grid
,
expansion
:
usize
,
alive_color
:
Color32
,
fade
:
bool
,
)
->
Grid
{
let
mut
new
=
grid
.clone
();
let
mut
new
=
grid
.clone
();
new
.clear_fill
();
new
.clear_fill
();
...
...
This diff is collapsed.
Click to expand it.
src/slide/s6_fractals.rs
+
7
−
2
View file @
2480cacc
...
@@ -12,7 +12,7 @@ use crate::egui;
...
@@ -12,7 +12,7 @@ use crate::egui;
use
crate
::
egui
::{
Color32
,
Context
,
Frame
,
Pos2
,
Shape
,
Stroke
,
Ui
};
use
crate
::
egui
::{
Color32
,
Context
,
Frame
,
Pos2
,
Shape
,
Stroke
,
Ui
};
use
crate
::
fade_in
::{
fade_in
,
fade_in_manual
,
fade_out
,
fade_out_manual
};
use
crate
::
fade_in
::{
fade_in
,
fade_in_manual
,
fade_out
,
fade_out_manual
};
use
crate
::
governor
::
Governor
;
use
crate
::
governor
::
Governor
;
use
crate
::
slide
::
s4_automata
::
randomize_grid
;
use
crate
::
slide
::
s4_automata
::
{
conways_game_of_life
,
randomize_grid
}
;
use
crate
::
slide
::
s6_fractals
::
circle
::
circle
;
use
crate
::
slide
::
s6_fractals
::
circle
::
circle
;
use
crate
::
slide
::
s6_fractals
::
dummy
::
is_black
;
use
crate
::
slide
::
s6_fractals
::
dummy
::
is_black
;
use
crate
::
slide
::
s6_fractals
::
mandelbrot
::
mandelbrot
;
use
crate
::
slide
::
s6_fractals
::
mandelbrot
::
mandelbrot
;
...
@@ -109,6 +109,11 @@ impl Default for Fractals {
...
@@ -109,6 +109,11 @@ impl Default for Fractals {
randomize_grid
(
&
mut
grid
);
randomize_grid
(
&
mut
grid
);
// Make grid more life-like.
for
_
in
0
..
10
{
grid
=
conways_game_of_life
(
&
grid
,
0
,
Color32
::
BLACK
,
false
);
}
// Grid cell stroke aliases too much at this resolution.
// Grid cell stroke aliases too much at this resolution.
grid
.stroke_width
=
0.0
;
grid
.stroke_width
=
0.0
;
...
@@ -271,7 +276,7 @@ impl Slide for Fractals {
...
@@ -271,7 +276,7 @@ impl Slide for Fractals {
// Fade out the automata cells.
// Fade out the automata cells.
for
(
_
,
_
,
cell
)
in
self
.grid
.iter_mut
()
{
for
(
_
,
_
,
cell
)
in
self
.grid
.iter_mut
()
{
if
cell
.a
()
>
0
{
if
cell
.a
()
>
0
{
*
cell
=
set_alpha
(
Color32
::
BLACK
,
alpha
);
*
cell
=
set_alpha
(
*
cell
,
alpha
);
}
}
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment