Skip to content

Commit

Permalink
Remove extra shapes from camera view example
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcomputerguy0101 committed Nov 21, 2024
1 parent e2049f2 commit 4af671e
Showing 1 changed file with 2 additions and 90 deletions.
92 changes: 2 additions & 90 deletions examples/camera_view/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,77 +32,7 @@ pub fn main() {
1000.0,
);

let mut sphere = Gm::new(
Mesh::new(&context, &CpuMesh::sphere(16)),
PhysicalMaterial::new_transparent(
&context,
&CpuMaterial {
albedo: Srgba {
r: 255,
g: 0,
b: 0,
a: 200,
},
..Default::default()
},
),
);
sphere.set_transformation(Mat4::from_translation(vec3(0.0, 1.3, 0.0)) * Mat4::from_scale(0.2));
let mut cylinder = Gm::new(
Mesh::new(&context, &CpuMesh::cylinder(16)),
PhysicalMaterial::new_transparent(
&context,
&CpuMaterial {
albedo: Srgba {
r: 0,
g: 255,
b: 0,
a: 200,
},
..Default::default()
},
),
);
cylinder
.set_transformation(Mat4::from_translation(vec3(1.3, 0.0, 0.0)) * Mat4::from_scale(0.2));
let mut cube = Gm::new(
Mesh::new(&context, &CpuMesh::cube()),
PhysicalMaterial::new_transparent(
&context,
&CpuMaterial {
albedo: Srgba {
r: 0,
g: 0,
b: 255,
a: 100,
},
..Default::default()
},
),
);
cube.set_transformation(Mat4::from_translation(vec3(0.0, 0.0, 1.3)) * Mat4::from_scale(0.2));
let axes = Axes::new(&context, 0.1, 2.0);
let bounding_box_sphere = Gm::new(
BoundingBox::new(&context, sphere.aabb()),
ColorMaterial {
color: Srgba::BLACK,
..Default::default()
},
);
let bounding_box_cube = Gm::new(
BoundingBox::new(&context, cube.aabb()),
ColorMaterial {
color: Srgba::BLACK,
..Default::default()
},
);
let bounding_box_cylinder = Gm::new(
BoundingBox::new(&context, cylinder.aabb()),
ColorMaterial {
color: Srgba::BLACK,
..Default::default()
},
);

let light0 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, -0.5, -0.5));
let light1 = DirectionalLight::new(&context, 1.0, Srgba::WHITE, vec3(0.0, 0.5, 0.5));
Expand Down Expand Up @@ -454,28 +384,10 @@ pub fn main() {

let screen = frame_input.screen();
screen.clear(ClearState::color_and_depth(0.8, 0.8, 0.8, 1.0, 1.0));
screen.render(
&camera,
sphere
.into_iter()
.chain(&cylinder)
.chain(&cube)
.chain(&axes)
.chain(&bounding_box_sphere)
.chain(&bounding_box_cube)
.chain(&bounding_box_cylinder),
&[&light0, &light1],
);
screen.render(&camera, axes.into_iter(), &[&light0, &light1]);
screen.render(
&debug_camera,
sphere
.into_iter()
.chain(&cylinder)
.chain(&cube)
.chain(&axes)
.chain(&bounding_box_sphere)
.chain(&bounding_box_cube)
.chain(&bounding_box_cylinder)
axes.into_iter()
.chain(&position_marker)
.chain(&target_marker)
.chain(&up_marker)
Expand Down

0 comments on commit 4af671e

Please sign in to comment.