Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with the code If the project builds and runs successfully, the OpenGL window will display two planes being rendered. Module Three starting 3

please help with the code
If the project builds and runs successfully, the OpenGL window will display two planes being rendered. Module Three starting 3D scene. Two white planes rendered on a black background. One plane serves as the background for the scene, and one serves as the floor. The goal of the assignment is to add basic 3D shapes to the scene that match the scale, position, and orientation shown in one of the 2D scenes below. You may choose any one of the 2D scenes for your 3D scene replication. Make sure that transformations are being applied to the basic 3D shapes to match the selected 2D scene. You may apply your own colors to the different 3D shapes to improve the look of the scene.
Cylinder, sphere, box, pyramid, and cone. Use transformations like scaling, rotation, and translation to make the replicated shapes look as close to the scene as possible in terms of scale, position, and orientation. You may also apply colors to the replicated shapes. The colors do not have to look exactly like those in the selected 2D image. Specifically, you must address the following rubric criteria: Create code to address the required functionality. The coding you complete in the project source code must meet the required functionality and visual representation outlined for this assignment. This result may require multiple attempts and programming 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. Organize code to meet formatting standards.
*PrepareScene()
void SceneManager::PrepareScene(){
m_basicMeshes->LoadPlaneMesh();
// Load additional basic 3D shapes
m_basicMeshes->LoadCylinderMesh();
m_basicMeshes->LoadSphereMesh();
m_basicMeshes->LoadBoxMesh();
m_basicMeshes->LoadPyramid3Mesh();
m_basicMeshes->LoadConeMesh();}
* RenderScene()
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
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(20.0f,1.0f,10.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =0.0f;
YrotationDegrees =0.0f;
ZrotationDegrees =0.0f;
// set the XYZ position for the mesh
positionXYZ = glm::vec3(0.0f,0.0f,0.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ,
XrotationDegrees,
YrotationDegrees,
ZrotationDegrees,
positionXYZ);
// set the color values into the shader
SetShaderColor(1,1,1,1);
// draw the mesh with transformation values
m_basicMeshes->DrawPlaneMesh();
/*Set needed transformations
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(20.0f,1.0f,10.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =90.0f;
YrotationDegrees =0.0f;
ZrotationDegrees =0.0f;
// set the XYZ position for the mesh
positionXYZ = glm::vec3(0.0f,9.0f,-10.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ,
XrotationDegrees,
YrotationDegrees,
ZrotationDegrees,
positionXYZ);
// set the color values into the shader
SetShaderColor(1,1,1,1);
// draw the mesh with transformation values
m_basicMeshes->DrawPlaneMesh();
//CylinderMesh
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(1.0f,2.0f,1.0f);
// set the XYZ rotation for the mesh
XrotationDegrees =0.0f;
YrotationDegrees =0.0f;
ZrotationDegrees =0.0f;
// set the XYZ position for the mesh
positionXYZ = glm::vec3(-2.0f,1.0f,0.0f);
// set the transformations into memory to be used on the drawn meshes
SetTransformations(
scaleXYZ,
XrotationDegrees,
YrotationDegrees,
ZrotationDegrees,
positionXYZ);
// set the color values into the shader
SetShaderColor(0.639,0.286,1,0.639);
// draw the mesh with transformation values
m_basicMeshes->DrawPlaneMesh();
//SphereMesh
// set the XYZ scale for the mesh
scaleXYZ = glm::vec3(1.0f,2.0f,1.0f);
// set the XYZ rotation for the mesh
And continue to code for the sphere mesh, Box mesh, Pyramid3 mesh,and the cone mesh.

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

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

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

1. If your script has a villain, are his motivations clear?

Answered: 1 week ago

Question

5. Structure your speech to make it easy to listen to

Answered: 1 week ago

Question

1. Describe the goals of informative speaking

Answered: 1 week ago