Answered step by step
Verified Expert Solution
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 D 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 D shapes to the scene that match the scale, position, and orientation shown in one of the D scenes below. You may choose any one of the D scenes for your D scene replication. Make sure that transformations are being applied to the basic D shapes to match the selected D scene. You may apply your own colors to the different D 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 D 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
mbasicMeshesLoadPlaneMesh;
Load additional basic D shapes
mbasicMeshesLoadCylinderMesh;
mbasicMeshesLoadSphereMesh;
mbasicMeshesLoadBoxMesh;
mbasicMeshesLoadPyramidMesh;
mbasicMeshesLoadConeMesh;
RenderScene
void SceneManager::RenderScene
declare the variables for the transformations
glm::vec scaleXYZ;
float XrotationDegrees f;
float YrotationDegrees f;
float ZrotationDegrees f;
glm::vec positionXYZ;
Set needed transformations
set the XYZ scale for the mesh
scaleXYZ glm::vecfff;
set the XYZ rotation for the mesh
XrotationDegrees f;
YrotationDegrees f;
ZrotationDegrees f;
set the XYZ position for the mesh
positionXYZ glm::vecfff;
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;
draw the mesh with transformation values
mbasicMeshesDrawPlaneMesh;
Set needed transformations
set the XYZ scale for the mesh
scaleXYZ glm::vecfff;
set the XYZ rotation for the mesh
XrotationDegrees f;
YrotationDegrees f;
ZrotationDegrees f;
set the XYZ position for the mesh
positionXYZ glm::vecfff;
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;
draw the mesh with transformation values
mbasicMeshesDrawPlaneMesh;
CylinderMesh
set the XYZ scale for the mesh
scaleXYZ glm::vecfff;
set the XYZ rotation for the mesh
XrotationDegrees f;
YrotationDegrees f;
ZrotationDegrees f;
set the XYZ position for the mesh
positionXYZ glm::vecfff;
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;
draw the mesh with transformation values
mbasicMeshesDrawPlaneMesh;
SphereMesh
set the XYZ scale for the mesh
scaleXYZ glm::vecfff;
set the XYZ rotation for the mesh
And continue to code for the sphere mesh, Box mesh, Pyramid mesh,and the cone mesh.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started