You would need a display port to HDMI adapter. One of the newer features (which the 2012 iMac has) is that it can display this type of content like a DVD player to the iMac.
Use the above link to review that item. It also has a DVI adapter that you would not use. But the display port to HDMI is the correct item. Then you connect the PS3 to the hdmi on it. I don't think it would passthrough audio though so you would have to figure something out for sound.