This question is from the 2004 CSE3313 exam. See if you can write an OpenGL program that solves the problem.
Consider the diagram below, which shows a simple robot arm simulation. The robot consists of three arm components, S1, S2, and S3 which are connected together and allowed to rotate with limited degrees of freedom as shown in the diagram.
Write a C function drawRobotArm
that draws the robot in its current state
using OpenGL. The function should take the following parameters: phi1
, phi2
,
phi3
, phi4
. These are the angles in degrees as shown in the diagram, representing
the current angles to use when drawing the robot. The function should use OpenGL
transformations to draw the robot in the correct position according to the
parameters passed.
You can assume the following:
L1
, L2
and L3
representing the lengths of S1, S2 and S3 respectively;DL1
, DL2
and DL3
for S1, S2 and S3 respectively;