Implmented triangle primitive, attemption to make things more generic