Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My lite shade isn t showing in the scene. There needs to be a light red shade to the light. * DefineObjectMaterials ( ) void
My lite shade isnt showing in the scene. There needs to be a light red shade to the light.
DefineObjectMaterials
void SceneManager::DefineObjectMaterials This function will set material properties such as diffuse, specular, ambient, etc.
OBJECTMATERIAL goldMaterial;
goldMaterial.ambientColor glm::vecfff;
goldMaterial.ambientStrength f;
goldMaterial.diffuseColor glm::vecfff;
goldMaterial.specularColor glm::vecfff;
goldMaterial.shininess ;
goldMaterial.tag "gold";
mobjectMaterials.pushbackgoldMaterial;
OBJECTMATERIAL cementMaterial;
cementMaterial.ambientColor glm::vecfff;
cementMaterial.ambientStrength f;
cementMaterial.diffuseColor glm::vecfff;
cementMaterial.specularColor glm::vecfff;
cementMaterial.shininess ;
cementMaterial.tag "cement";
mobjectMaterials.pushbackcementMaterial;
OBJECTMATERIAL woodMaterial;
woodMaterial.ambientColor glm::vecfff;
woodMaterial.ambientStrength f;
woodMaterial.diffuseColor glm::vecfff;
woodMaterial.specularColor glm::vecfff;
woodMaterial.shininess ;
woodMaterial.tag "wood";
mobjectMaterials.pushbackwoodMaterial;
OBJECTMATERIAL TileMaterial;
TileMaterial.ambientColor glm::vecfff;
TileMaterial.ambientStrength f;
TileMaterial.diffuseColor glm::vecfff;
TileMaterial.specularColor glm::vecfff;
TileMaterial.shininess ;
TileMaterial.tag "Tile";
mobjectMaterials.pushbackTileMaterial;
OBJECTMATERIAL glassMaterial;
glassMaterial.ambientColor glm::vecfff;
glassMaterial.ambientStrength f;
glassMaterial.diffuseColor glm::vecfff;
glassMaterial.specularColor glm::vecfff;
glassMaterial.shininess ;
glassMaterial.tag "glass";
mobjectMaterials.pushbackglassMaterial;
OBJECTMATERIAL clayMaterial;
clayMaterial.ambientColor glm::vecfff;
clayMaterial.ambientStrength f;
clayMaterial.diffuseColor glm::vecfff;
clayMaterial.specularColor glm::vecfff;
clayMaterial.shininess ;
clayMaterial.tag "clay";
mobjectMaterials.pushbackclayMaterial;
SetupSceneLights
void SceneManager::SetupSceneLights
Define properties of the first light
mpShaderManagersetVecValuelightSourcesposition", fff;
mpShaderManagersetVecValuelightSourcesambientColor", fff; Red ambient color
mpShaderManagersetVecValuelightSourcesdiffuseColor", fff; Red diffuse color
mpShaderManagersetVecValuelightSourcesspecularColor", fff; Red specular color
mpShaderManagersetFloatValuelightSourcesfocalStrength", f;
mpShaderManagersetFloatValuelightSourcesspecularIntensity", f;
Define properties of the second light
mpShaderManagersetVecValuelightSourcesposition", fff;
mpShaderManagersetVecValuelightSourcesambientColor", fff; Green ambient color
mpShaderManagersetVecValuelightSourcesdiffuseColor", fff; Green diffuse color
mpShaderManagersetVecValuelightSourcesspecularColor", fff; Green specular color
mpShaderManagersetFloatValuelightSourcesfocalStrength", f;
mpShaderManagersetFloatValuelightSourcesspecularIntensity", f;
Define properties of the third light
mpShaderManagersetVecValuelightSourcesposition", fff;
mpShaderManagersetVecValuelightSourcesambientColor", fff; Blue ambient color
mpShaderManagersetVecValuelightSourcesdiffuseColor", fff; Blue diffuse color
mpShaderManagersetVecValuelightSourcesspecularColor", fff; Blue specular color
mpShaderManagersetFloatValuelightSourcesfocalStrength", f;
mpShaderManagersetFloatValuelightSourcesspecularIntensity", f;
Enable lighting in the shader
mpShaderManagersetBoolValuebUseLighting 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::
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