Fix shapes example
@@ -22,7 +22,9 @@ pub fn main() {
let mut sphere = Gm::new(
Mesh::new(&context, &CpuMesh::sphere(16)).unwrap(),
- PhysicalMaterial {
+ PhysicalMaterial::new_transparent(
+ &context,
+ &CpuMaterial {
albedo: Color {
r: 255,
g: 0,
@@ -31,11 +33,15 @@ pub fn main() {
},
..Default::default()
},
+ )
+ .unwrap(),
);
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)).unwrap(),
- PhysicalMaterial {
+ PhysicalMaterial::new_transparent(
+ &context,
+ &CpuMaterial {
albedo: Color {
r: 0,
g: 255,
@@ -44,12 +50,16 @@ pub fn main() {
},
..Default::default()
},
+ )
+ .unwrap(),
);
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()).unwrap(),
- PhysicalMaterial {
+ PhysicalMaterial::new_transparent(
+ &context,
+ &CpuMaterial {
albedo: Color {
r: 0,
g: 0,
@@ -58,6 +68,8 @@ pub fn main() {
},
..Default::default()
},
+ )
+ .unwrap(),
);
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, 1.0).unwrap();
