Question: Start with the C + + driver provided in the assignment archive. This program has one shape using the builtin vertex coloring for that shape.
Start with the C driver provided in the assignment archive. This program has one shape using the builtin vertex coloring for that shape.
Change the display to four blocks, the blocks should be colored using the builtin vertex coloring.
Create a single block shape object. This will be shared by several artifacts.
There should be four artifacts, each using the block shape.
Use the world transform for the following
Each artifact should be scaled in the x direction, in the y direction, in the z direction
There should be an artifact centered at each of the points
In the code the first artifact defined should be at the second at the third at and the fourth at
These blocks should be rotated
The block at should be rotated deg around the x axis
The block at should be rotated deg around the y axis
The block at should be rotated deg around the z axis
The block at should be rotated deg around the x axis
Sou#include GLMgtctypeptrhpp
#include
#include "learnopenglshaderh
#include csartifacth
#include cswindowh
#include csbufferutilities.h
static std::vector artifactlist;
static Shader shader;
void init
shader new Shadermoreshapesvertexshader.glsl
moreshapesfragmentshader.glsl;
shaderuse;
glEnableGLPROGRAMPOINTSIZE;
glEnableGLDEPTHTEST;
cs::Shape b new cs::Torus;
auto transformation new cs::TransformationAnimationRotating;
transformationmultiplyScalefff;
transformationmultiplyTranslation;
auto artf new cs::Artifacttransformation;
artftheShape b;
artifactlist.pushbackartf;
cs::initBuffersshaderID artifactlist, bposition", bcolor";
void render
for auto artf : artifactlist
auto modelmatrix artfworldTransformationgetMatrix;
shadersetMatutransform", modelmatrix;
glDrawArraysGLTRIANGLES, artftheShapebufferStart, artftheShapebufferSize;
int main
glfwInit;
cs::setOpenglVersion;
GLFWwindow window cs::setupWindowMore Shapes", ;
glfwMakeContextCurrentwindow;
gladLoadGLglfwGetProcAddress;
init;
while glfwWindowShouldClosewindow
glClearBufferfvGLCOLOR, cs::X::grayasFloatArray;
glClearGLDEPTHBUFFERBIT;
render;
glfwSwapBufferswindow;
glfwPollEvents;
glfwDestroyWindowwindow;
glfwTerminate;
rce code given:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
