Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) Refer to the OpenGL code fragment in Figure 3 below: qlBegin (GL POLYGON) glVertex3f(-0.7f, -0.5f, 0.0f); glVertex 3f (0.7f, -0.5f, 0.0f); gl Vertex3F(0.4, 0.5f,
a) Refer to the OpenGL code fragment in Figure 3 below: qlBegin (GL POLYGON) glVertex3f(-0.7f, -0.5f, 0.0f); glVertex 3f (0.7f, -0.5f, 0.0f); gl Vertex3F(0.4, 0.5f, 0.0f); glVertex 3 (-0.45, 0.5f, 0.0f); glEnd(); Figure 3: OpenGL code fragment i. What is the shape of the polygon drawn using the code fragment in Figure 3? (2 marks) it. Add codes so that each vertex has different colour. (4 marks) ili. In OpenGL, we can associate a color with each vertex. What happen if the endpoints of a line segment have different colors assigned to them? (3 marks) b) Explain how any sequence of rotations and translations can be replaced by a single rotation about the origin followed by a translation. You may illustrate your answer with diagrams. (16 marks) a) Refer to the OpenGL code fragment in Figure 3 below: qlBegin (GL POLYGON) glVertex3f(-0.7f, -0.5f, 0.0f); glVertex 3f (0.7f, -0.5f, 0.0f); gl Vertex3F(0.4, 0.5f, 0.0f); glVertex 3 (-0.45, 0.5f, 0.0f); glEnd(); Figure 3: OpenGL code fragment i. What is the shape of the polygon drawn using the code fragment in Figure 3? (2 marks) it. Add codes so that each vertex has different colour. (4 marks) ili. In OpenGL, we can associate a color with each vertex. What happen if the endpoints of a line segment have different colors assigned to them? (3 marks) b) Explain how any sequence of rotations and translations can be replaced by a single rotation about the origin followed by a translation. You may illustrate your answer with diagrams. (16 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started