Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The shapes in the 3 D scene are all white and look flat. The goal is to add two different light sources at different positions
The shapes in the D scene are all white and look flat. The goal is to add two different light sources at different positions to improve the look of the scene and define the D shapes better. Also, add some color to one of the lights to bring more color into the scene. The following picture shows an example D scene after the two lighting sources have been added. Specifically, you must address the following rubric criteria:Create code to address the required functionality. The work you complete in the project source code must meet the required functionality and visual representation that are outlined for this assignment. Apply logic and proper syntax to code. Apply commenting and formatting standards to facilitate understanding of the code. All code should be well commented. Your comments should explain the purpose of lines or sections of the code and may also include how you achieved a specific task in the code.
DefineObjectMaterials
void SceneManager::DefineObjectMaterials
SetupSceneLights
void SceneManager::SetupSceneLights
this line of code is NEEDED for telling the shaders to render
the D scene with custom lighting, if no light sources have
been added then the display window will be black to use the
default OpenGL lighting then comment out the following line
mpShaderManagersetBoolValuegUseLightingName, true;
PrepareScene
void SceneManager::PrepareScene
define the materials for objects in the scene
DefineObjectMaterials;
add and define the light sources for the scene
SetupSceneLights;
mbasicMeshesLoadBoxMesh;
mbasicMeshesLoadPlaneMesh;
mbasicMeshesLoadCylinderMesh;
mbasicMeshesLoadConeMesh;
mbasicMeshesLoadSphereMesh;
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 active color values in the shader RGBA
SetShaderColor;
draw the mesh with transformation values this plane is used for the base
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 active color values in the shader RGBA
SetShaderColor;
draw a filled cylinder shape
mbasicMeshesDrawCylinderMesh;
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 active color values in the shader RGBA
SetShaderColor;
draw a filled box shape
mbasicMeshesDrawBoxMesh;
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 active color values in the shader RGBA
SetShaderColor;
draw a filled box shape
mbasicMeshesDrawBoxMesh;
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
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