nannou
nannou copied to clipboard
polyline does not support 3D?
let mut pts = Vec::new();
pts.push(vec3(-100.0,-100.0,100.0));
pts.push(vec3(100.0,-100.0,100.0));
pts.push(vec3(100.0,100.0,100.0));
pts.push(vec3(-100.0,100.0,100.0));
pts.push(vec3(-150.0,-150.0,-100.0));
pts.push(vec3(150.0,-150.0,-100.0));
pts.push(vec3(150.0,150.0,-100.0));
pts.push(vec3(-150.0,150.0,-100.0));
draw.polyline().points(pts).y_radians(app.mouse.x).x_radians(45.0);
above code and don't see rotation in space
i just tried it to see if it would work, and it did work fine.
use nannou::prelude::*;
fn main() {
nannou::sketch(view).run()
}
fn view(app: &App, frame: Frame) {
// Begin drawing
let draw = app.draw();
// Clear the background to black.
draw.background().color(BLUE);
let mut pts = Vec::new();
pts.push(vec3(-100.0, -100.0, 100.0));
pts.push(vec3(100.0, -100.0, 100.0));
pts.push(vec3(100.0, 100.0, 100.0));
pts.push(vec3(-100.0, 100.0, 100.0));
pts.push(vec3(-150.0, -150.0, -100.0));
pts.push(vec3(150.0, -150.0, -100.0));
pts.push(vec3(150.0, 150.0, -100.0));
pts.push(vec3(-150.0, 150.0, -100.0));
draw.polyline()
.points(pts)
//.color(rgb(128f32, 0f32, 128f32))
.y_radians(app.mouse.x)
.x_radians(45.0);
draw.to_frame(app, &frame).unwrap();
}