asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.33k stars 110 forks source link

Crash in `Mesh::draw` #317

Closed mdegans closed 1 year ago

mdegans commented 1 year ago

Occasionally, self.transformation.invert() in Mesh::draw returns a None, resulting in a crash:

        program.use_uniform_if_required(
            "normalMatrix",
            &self.transformation.invert().unwrap().transpose(),
        );

Seems this is because I was animating a transform which caused scale in all dimensions to occasionally reach 0.0 (and so the determinant is 0, None is returned, and 💥boom💥).