Added code for triangle rendering