Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you create code for the assignment below: Black background with two identical white triangles. Each triangle has bottom corner cut off. The above image

Can you create code for the assignment below:
Black background with two identical white triangles. Each triangle has bottom corner cut off.
The above image shows two four
-
sided pyramids. The goal of this assignment is to change the transformation code in the SceneManager::RenderScene
(
)
method for each pyramid to make the two pyramids match the following picture:
A white triangle inverted above another white triangle so their tips meet form an hourglass shape.
Specifically, you must address the following rubric criteria:
Create code to address the required functionality. The code you add must meet the required functionality and visual representation outlined for this assignment. This result may require multiple attempts and strategies to get it right, but that is okay! Working in stages is an important part of any coding project.
Apply logic and proper syntax to code. Source code should be free of logical or syntax errors that prevent the application from running as expected. You will be given credit for code that is set up to meet specifications or solve the problem.
Apply commenting and formatting standards to facilitate understanding of the code. All code should be well commented. Commenting is a practiced art. Your comments should be as clear and brief as possible. Your comments should explain the purpose of lines or sections of the code. You may also include the method you used to achieve a specific task in the code. Be sure to document any sections of code that produce errors or incorrect results. Organize all code to meet formatting standards.
SceneManager.cpp
///////////////////////////////////////////////////////////////////////////////
// scenemanager.h
//============
// manage the preparing and rendering of 3D scenes - textures, materials, lighting
//
#pragma once
#include "ShaderManager.h"
#include "ShapeMeshes.h"
#include
#include
/***********************************************************
* SceneManager
*
* This class contains the code for preparing and rendering
*3D scenes, including the shader settings.
***********************************************************/
class SceneManager
{
public:
// constructor
SceneManager(ShaderManager *pShaderManager);
// destructor
~SceneManager();
// properties for loaded texture access
struct TEXTURE_INFO
{
std::string tag;
uint32_t ID;
};
// properties for object materials
struct OBJECT_MATERIAL
{
float ambientStrength;
glm::vec3 ambientColor;
glm::vec3 diffuseColor;
glm::vec3 specularColor;
float shininess;
std::string tag;
};
private:
// pointer to shader manager object
ShaderManager* m_pShaderManager;
// pointer to basic shapes object
ShapeMeshes *m_basicMeshes;
// total number of loaded textures
int m_loadedTextures;
// loaded textures info
TEXTURE_INFO m_textureIDs[16];
// defined object materials
std::vector m_objectMaterials;
// set the transformation values
// into the transform buffer
void SetTransformations(
glm::vec3 scaleXYZ,
float XrotationDegrees,
float YrotationDegrees,
float ZrotationDegrees,
glm::vec3 positionXYZ);
// set the color values into the shader
void SetShaderColor(
float redColorValue,
float greenColorValue,
float blueColorValue,
float alphaValue);
public:
/*** The following methods are for the students to ***/
/*** customize for their own 3D scene ***/
void PrepareScene();
void RenderScene();
};
ViewManager.cpp
///////////////////////////////////////////////////////////////////////////////
// viewmanager.h
//============
// manage the viewing of 3D objects within the viewport - camera, projection
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "ShaderManager.h"
#include "camera.h"
// GLFW library
#include "GLFW/glfw3.h"
class ViewManager
{
public:
// constructor
ViewManager(
ShaderManager* pShaderManager);
// destructor
~ViewManager();
// mouse position callback for mouse interaction with the 3D scene
static void Mouse_Position_Callback(GLFWwindow* window, double xMousePos, double yMousePos);
//mouse wheel scrolling callback for mouse interaction with the 3D scene
static void Mouse_Wheel_Callback(GLFWwindow* window, double x, double yScrollDistance);
private:
// pointer to shader manager object
ShaderManager* m_pShaderManager;
// active OpenGL display window
GLFWwindow* m_pWindow;
// process keyboard events for interaction with the 3D scene
void ProcessKeyboardEvents();
public:
// create the initial OpenGL display window
GLFWwindow* CreateDisplayWindow(const char* windowTitle);
// prepare the conversion from 3D object display to 2D scene display
void PrepareSceneView();
};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions