Create and rotate a triangle about the origin and a fixed point

#include #include #include #include int x,y; int rFlag=0; void draw_pixel(float x1,float y1) { glColor3f(0.0,0.0,1.0); glPointSize(5.0); glBegin(GL_POINTS); glVertex2f(x1,y1); glEnd(); } void triangle() { glColor3f(1.0,0.0,0.0); glBegin(GL_POLYGON); glVertex2f(100,100); glVertex2f(250,400); glVertex2f(400,100); glEnd(); } float…

Continue ReadingCreate and rotate a triangle about the origin and a fixed point

Design, develop and implement recursively subdivide a tetrahedron to form 3D sierpinski gasket. The number of recursive steps is to be specified by the user

Algorithm:Step 1: Specify the four vertices that form a tetrahedronStep 2: Input the number of subdivisions n.Step 3: Select any three vertices that form one of the triangular faces of…

Continue ReadingDesign, develop and implement recursively subdivide a tetrahedron to form 3D sierpinski gasket. The number of recursive steps is to be specified by the user