Adding some code for triangle primitives