Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

After opening the 2 - 2 _ Assignment project in Visual Studio 2 0 2 2 , try to build and run the project. If

After opening the 2-2_Assignment project in Visual Studio 2022, try to build and run the project. If the project builds and runs successfully, the OpenGL window should display two four-sided pyramids side by side. If you do not see the image below, reach out to your instructor for help.
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.
Here is the code i have so far
/***********************************************************
* RenderScene(
* This method is used for rendering the 3D scene by
* transforming and drawing the basic 3D shapes
***********************************************************/
void SceneManager::RenderScene()
{
// declare the variables for the transformations
glm::vec3 scaleXYZ;
float XrotationDegrees =0.0f;
float YrotationDegrees =0.0f;
float ZrotationDegrees =0.0f;
glm::vec3 positionXYZ;
/*** Set needed transformations before drawing the basic mesh. ***/
/*** This same ordering of code should be used for transforming ***/
/*** and drawing all the basic 3D shapes. ***/
/******************************************************************/
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(1.0f,1.0f,1.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =0.0f; // no rotation around x-axis
YrotationDegrees =0.0f; // no rotation around y-axis
ZrotationDegrees =0.0f; // no rotation around z-axis
// set the XYZ position for the mesh
positionXYZ = glm::vec3(1.5f,0.0f,-6.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ = glm::vec3(1.0f,1.0f,1.0f);
XrotationDegrees =180.0f;//Rotates around X-axis 180 degrees to invert the pyramid
YrotationDegrees =0.0f; // no rotation around y-axis
ZrotationDegrees =0.0f; // no rotation around z-axis
positionXYZ = glm::vec3(1.5f,0.0f,-6.0f);
SetShaderColor(1,1,1,1);//sets shading color to white
// draw the mesh with transformation values
m_basicMeshes->DrawPyramid4Mesh();
SetShaderColor(1,1,1,1);//sets shading color to white
// draw the mesh with transformation values
m_basicMeshes->DrawPyramid4MeshLines();
/****************************************************************/
/*** Set needed transformations before drawing the basic mesh. ***/
/*** This same ordering of code should be used for transforming ***/
/*** and drawing all the basic 3D shapes. ***/
/******************************************************************/
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(1.0f,1.0f,1.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =0.0f;// no rotation on x-axis
YrotationDegrees =0.0f;// no rotation on y-axis
ZrotationDegrees =0.0f;// no rotation on z-axis
// set the XYZ position for the mesh
positionXYZ = glm::vec3(-1.5f,0.0f,-6.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ = glm::vec3(1.0f,1.0f,1.0f);
XrotationDegrees =0.0f;// no rotation on x-axis
YrotationDegrees =0.0f;// no rotation on y-axis
ZrotationDegrees =0.0f;// no rotation on z-axis
positionXYZ = glm::vec3(1.5f,0.0f,-6.0f);
SetShaderColor(1,1,1,1);
// draw the mesh with transformation values
m_basicMeshes->DrawPyramid4Mesh();
SetShaderColor(1,1,1,1);
// draw the mesh with transformation values
m_basicMeshes->DrawPyramid4MeshLines();
/****************************************************************/
}
Please help

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

Students also viewed these Databases questions

Question

OUTCOME 6 Explain and give examples of diversity management.

Answered: 1 week ago