Question: ` ` ` different _ effects.cpp ode _ fa 2 4 > 0 3 - different - effects > @ + different _ effects.cpp >

```
different_effects.cpp
ode_fa24>03-different-effects > @+ different_effects.cpp >...
#include
#include
#include
#include "learnopengl/shader_4722.h"
#include "cs4722/view.h"
#include "cs4722/artifact.h"
#include "cs4722/texture_utilities.h"
#include "cs4722/buffer_utilities.h"
#include "cs4722/window.h"
#include "../callbacks.h"
static cs4722::View *the_view;
static Shader *shader;
static std::vector artifact_list;
void init()
{
the_view = new cs4722::View();
the_view->setFLUP(glm::vec3(0,0,1),
glm::vec3(1,0,0),
glm::vec3(0,1,0),
glm::vec3(-.5,0,-2));
the_view->setFLUP(
glm::vec3(0.011578,0.0499792,-0.998684),
glm::vec3(-0.999933,0,-0.0115925),
glm::vec3(-0.000579383,0.998751,0.0499759),
glm::vec3(2.77569,-0.204956,3.79724)
);
the_view->enableLogging = false;
shader = new Shader("vertex_shader03.glsl","fragment_shader03.glsl");
shader->use();
glEnable(GL_DEPTH_TEST);
// cs4722::init_texture_from_file("../media/729144-real-myst-windows-screenshot-beautiful-detail-in-the-graphics.png",1);
cs4722::initCheckerboardTexture(1,8,0,255,256);
cs4722::Shape* b = new cs4722::Torus();
b->colorSet = std::vector({cs4722::X11::gray50, cs4722::X11::gray75});
// b->color_set_= std::vector({cs4722::x11::blue, cs4722::x11::green});
auto const diffuse_color_common = cs4722::X11::steel_blue;
auto* artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale(glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(0,2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =0;
artifact_list.push_back(artf);
```
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(2,2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =1;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(4,2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =2;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(6,2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =3;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(0,-2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =4;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(2,-2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =5;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(4,-2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =6;
artifact_list.push_back(artf);
artf = new cs4722::Artifact();
artf->theShape =(b);
artf->worldTransformation->multiplyScale( glm::vec3(.4f,.6f,.4f));
artf->worldTransformation->multiplyTranslation(glm::vec3(6,-2,0));
artf->surfaceMaterial.diffuseColor = diffuse_color_common;
artf->textureUnit =1;
artf->surfaceEffect =7;
artifact_list.push_back(artf);
``````
void init()
arlt->SurTalecritlL =/;
artifact_list.push_back(artf);
cs4722::initBuffers(shader->ID, artifact_list,
"bPosition",
"bColor",
"bTextureCoord");
}
void render()
{
auto view_transform = glm::lookAt(the_view->cameraPosition,
the_view->cameraPosition + the_view->cameraForward,
the_view->cameraUp);
auto projection_transform = glm::infinitePerspective(the_view->perspectiveFOVY,
the_

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!