Rotational camera added. World Space movement adde

This commit is contained in:
2024-10-02 16:54:06 +02:00
parent 8ce8b1e6f8
commit 4f83bb738c
7 changed files with 248 additions and 43 deletions

View File

@@ -153,4 +153,44 @@ namespace dae {
AddPlane({ 0.f, 0.f, 125.f }, { 0.f, 0.f,-1.f }, matId_Solid_Magenta);
}
#pragma endregion
void Scene_W2::Initialize()
{
m_Camera.origin = { 0.f,3.f,-9.f };
m_Camera.fovAngle = 45.f;
//default: Material id0 >> SolidColorMaterial (RED)
constexpr unsigned char matId_Solid_Red = 0;
const unsigned char matId_Solid_Blue = AddMaterial(new Material_SolidColor{ colors::Blue });
const unsigned char matId_Solid_Yellow = AddMaterial(new Material_SolidColor{ colors::Yellow });
const unsigned char matId_Solid_Green = AddMaterial(new Material_SolidColor{ colors::Green });
const unsigned char matId_Solid_Magenta = AddMaterial(new Material_SolidColor{ colors::Magenta });
const unsigned char matId_Solid_Porple = AddMaterial(new Material_SolidColor{ ColorRGB(207, 159, 255)});
//Plane
AddPlane({ -5.f,0.f,0.f }, { 1.f,0.f,0.f }, matId_Solid_Green);
AddPlane({ 5.f,0.f,0.f }, { -1.f,0.f,0.f }, matId_Solid_Green);
AddPlane({ 0.f,0.f,0.f }, { 0.f,1.f,0.f }, matId_Solid_Yellow);
AddPlane({ 0.f,10.f,0.f }, { 0.f,-1.f,0.f }, matId_Solid_Yellow);
AddPlane({ 0.f,0.f,10.f }, { 0.f,0.f,-1.f }, matId_Solid_Magenta);
//Spheres
AddSphere({-1.75f,1.f,0.f}, .75f, matId_Solid_Red);
AddSphere({0.f,1.f,0.f}, .75f, matId_Solid_Blue);
AddSphere({ 1.75f,1.f,0.f }, .75f, matId_Solid_Red);
AddSphere({ -1.75f,3.f,0.f }, .75f, matId_Solid_Blue);
AddSphere({ 0.f,3.f,0.f }, .75f, matId_Solid_Red);
AddSphere({ 1.75f,3.f,0.f }, .75f, matId_Solid_Blue);
AddSphere({ 0.f,5.f,0.f }, .75f, matId_Solid_Porple);
//Light
AddPointLight({ 0.f,5.f,-5.f }, 70.f, colors::White);
}
}