Jerermy Cox gave a fascinating talk at the Cinema 4D Supermeet 2018 where he develops a working 3-d model of various cameras, from a pinhole camera to SLR camera in Cinema 4D and Indigo.He gets some really nice results out of it including some realistic lens flare and depth of field.Watch the presentation here.