common and potential mistakes: - forget to reset homogeneous coordinates correctly (points: 1, vectors: 0) - normalize some vectors when you shouldn't (e.g., ray directions) - forget to normalize vectors when you should (e.g., normals) - forget to update inverse transformation matrices (e.g., _imat) - forget to update inner matrices with updateTransform(), or update at a wrong time - incorrectly marking ray tracing as hit/miss - recursively ray-trace at the same point (of the same object) - use exact equality for floating-point numbers (precision errors) debugging tips: - to debug or visualize normal vectors, you may use their coordinates as actual object colors. In this case, you may have to adjust value ranges from [-1,1] to [0,1]. Then the colors should vary smoothly on smooth surfaces. Suggested controls for adding/removing objects: - to add an object, press 'n' followed by a number, or 'n' again to cancel adding - to remove the selected object, press 'm' - print to the console informative messages for how to add/remove objects Report any bug inverse matrix already computed when checking ray-object intersection bullets: Release (146s) vs Debug (557s)