m 11
parent
b21d7d56b3
commit
7506d4907f
|
@ -109,16 +109,20 @@ fn view(app: &App, model: &Model, frame: Frame) {
|
||||||
// rotate
|
// rotate
|
||||||
let v = rot(t) * v;
|
let v = rot(t) * v;
|
||||||
// project onto xz plane cause it's the coolest one
|
// project onto xz plane cause it's the coolest one
|
||||||
100.0 * vec2(v.x, v.z)
|
50.0 * vec2(v.x + v.y, v.z + v.w)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
// make all pairs of points
|
|
||||||
let p = p
|
for (i, (&a, &b)) in p
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.flat_map(|(i, a)| p[i + 1..].iter().map(move |b| (a, b)));
|
// make all pairs of points
|
||||||
for (&a, &b) in p {
|
.flat_map(|(i, a)| p[i + 1..].iter().map(move |b| (a, b)))
|
||||||
draw.line().points(a, b).color(BLACK);
|
.enumerate()
|
||||||
|
{
|
||||||
|
if i % 2 != 0 {
|
||||||
|
draw.line().points(a, b).color(BLACK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw.to_frame(app, &frame).unwrap();
|
draw.to_frame(app, &frame).unwrap();
|
||||||
|
|
Loading…
Reference in New Issue