Question
1A. Write a C or C++ program that draws a triangle and a box. The triangle should be placed on top of the box and
1A. Write a C or C++ program that draws a triangle and a box. The triangle should be placed on top of the box and just touching the box (see the picture below). Your program shall have one window with the two objects displayed in the center.
1B. Write comments for each line of code, explaining what this line does.
1C. On Windows, you must use freeglut, glew, glm, and SOIL libraries. On other platforms, if you are unable to make OpenGL work, you may use WebGL.
1D Must use shader-based OpenGL (OpenGL 3.x) to implement the program. DO NOT use old, fixed-function OpenGL APIs (OpenGL 1.x or 2.x) such as glBegin(), glVertex3f(), glTranslate(), glPushMatrix(), etc.
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