My intent with this code is to get the points that form the outline of an object from a camera angle. What's wrong with it?

let camera = Matrix4::look_at_lh(
                        &Point3::new(0f32, 0., -1.),
                        &Point3::origin(),
                        &Vector3::y(),
                    ) * Matrix4::new_perspective(16. / 9., 90f32.to_radians(), 0.1, 100.);
                    let points = i.vertices.into_iter().map(|v|{
                        let pos = v.position;
                        let pos = Point3::new(pos[0], pos[1], pos[2]);
                        pos
                    }).collect::<Vec<_>>();
                    let average = points.iter().map(|v|{
                        v.coords
                    }).sum::<Vector3<f32>>().norm()/points.len() as f32;
                    let convex = points.into_iter()
                        .map(|v| {
                            Point2::from((camera * Vector4::from(v)).to_homogeneous().xy())
                        })
                        .collect::<Vec<_>>();
                    let col = ConvexPolygon::from_convex_hull(&convex).unwrap_unchecked();
                    let convex = convex
                        .into_iter()
                        .filter(|v| {
                            !col.contains_point(&Isometry2::identity(), v)
                        })
                        .collect::<Vec<_>>();
                    println!("{:?}", convex.len());
                }

That's a good question: what is wrong with it? What's not working as expected?

It used to work, yet now it shows only 24 vertices as the length, where it should be 32 at the rim of a cube subdivided thrice. Further more, it show vertices when the mesh is the same size or less as the convex hull.

What changed between it working and it not working?

I'm honestly not sure. All I did is made the code a little cleaner.