Make a function that draws a pyramid at a specific point, this point being the middle of the triangle.
Note: the height of the triangle is sqrt(3)/2 times the side length.
Negating the height will reverse the pyramid.
Did you actually need rotatable triangles? It would have been a lot simpler if you could assume that the triangles would always point in the same direction.
well but in the assignment the lecturer demanded : "a single number to indicate the angle of one vertex. This angle must be specified in radians, so if the vertex is straight up (above the center), then that parameter would have a value of M_PI/2. (The name M_PI is a predefined constant for pi from #include <cmath>.) Since the triange is equilateral, the other two vertexes will be at angles that are 2*M_PI/3 after the first vertex and 2*M_PI/3 before the first vertex."