From 639a53157e7d3936caf7c3e40379159cbcf4c89e Mon Sep 17 00:00:00 2001 From: Mark Oliver Mints <mmints@uni-koblenz.de> Date: Mon, 13 Sep 2021 09:20:43 +0200 Subject: [PATCH] [#94] Funky balls --- projects/saf_r/src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/saf_r/src/main.cpp b/projects/saf_r/src/main.cpp index 6078bf5c..118c8306 100644 --- a/projects/saf_r/src/main.cpp +++ b/projects/saf_r/src/main.cpp @@ -93,7 +93,8 @@ int main(int argc, const char** argv) { //spheres for the scene std::vector<safrScene::Sphere> spheres; spheres.push_back(safrScene::Sphere(glm::vec3(-3.0, 0.0, 16), 2, ivory)); - spheres.push_back(safrScene::Sphere(glm::vec3(-1.0, -1.5, 12), 2, mirror)); + // spheres.push_back(safrScene::Sphere(glm::vec3(-1.0, -1.5, 12), 2, mirror)); + spheres.push_back(safrScene::Sphere(glm::vec3(1.5, -0.5, 23), 2, mirror)); spheres.push_back(safrScene::Sphere(glm::vec3( 1.5, -0.5, 18), 3, red_rubber)); spheres.push_back(safrScene::Sphere(glm::vec3( 7.0, 5.0, 18), 4, mirror)); @@ -218,11 +219,18 @@ int main(int argc, const char** argv) { start = end; time += 0.000001f * static_cast<float>(deltatime.count()); - + + /* lights[0].position.x += std::cos(time * 3.0f) * 2.5f; lights[1].position.z += std::cos(time * 2.5f) * 3.0f; lights[2].position.y += std::cos(time * 1.5f) * 4.0f; lightsBuffer.fill(lights); + */ + + spheres[0].center.y += std::cos(time * 0.5f * 3.141f) * 0.25f; + spheres[1].center.x += std::cos(time * 2.f) * 0.25f; + spheres[1].center.z += std::cos(time * 2.f + 0.5f * 3.141f) * 0.25f; + sphereBuffer.fill(spheres); cameraManager.update(0.000001 * static_cast<double>(deltatime.count())); glm::mat4 mvp = cameraManager.getActiveCamera().getMVP(); -- GitLab