holding this some more

PHOTO EMBED

Tue Apr 04 2023 23:51:10 GMT+0000 (Coordinated Universal Time)

Saved by @gabbi #opengl #c++

        // tennis rackets
        for(int item = 0; item < 2; item++) {
            glm::mat4 world_transform_matrix = glm::mat4(1.0f);
            // global transforms
            world_transform_matrix = glm::translate(world_transform_matrix, starting_locations[item]);
            world_transform_matrix = rotate(world_transform_matrix, r[item]);
            world_transform_matrix = glm::scale(world_transform_matrix, s[item]);

            glm::mat4 arm_transform_matrix = world_transform_matrix;
            glm::mat4 racket_transform_matrix = world_transform_matrix;

            // -- arm -- // tranforms cube to create arm
            // forearm (skin)
            arm_transform_matrix =  tennis_rackets[item][0].cubeRotate(arm_transform_matrix, glm::vec3(45.0f, 0.0f, 0.0f));
            arm_transform_matrix = tennis_rackets[item][0].cubeScale(arm_transform_matrix, glm::vec3(0.5f, 2.0f, 0.5f));
            tennis_rackets[item][0].drawCube(arm_transform_matrix);
            arm_transform_matrix = tennis_rackets[item][0].cubeScale(arm_transform_matrix, glm::vec3(1/0.5f, 1/2.0f, 1/0.5f));

            // arm (skin)
            arm_transform_matrix = tennis_rackets[item][0].cubeTranslate(arm_transform_matrix, glm::vec3(0.0f, 2.0f * 0.1f, 0.0f));
            arm_transform_matrix =  tennis_rackets[item][0].cubeRotate(arm_transform_matrix, glm::vec3(-45.0f, 0.0f, 0.0f));
            arm_transform_matrix = tennis_rackets[item][0].cubeScale(arm_transform_matrix, glm::vec3(0.5f, 2.0f, 0.5f));
            tennis_rackets[item][0].drawCube(arm_transform_matrix);
            arm_transform_matrix = tennis_rackets[item][0].cubeScale(arm_transform_matrix, glm::vec3(1/0.5f, 1/2.0f, 1/0.5f));

            // -- tennis racket shape -- // transforms cube to create racket
            // handle
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f, 3.0f * 0.1f, -0.15f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 2.5f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/2.5f, 1/0.25f));
            // racket
            // racket angled bottom left
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  2.5f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(-70.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 1.5f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/1.5f, 1/0.25f));
            // racket vertical left
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  1.5f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(70.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 2.0f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/2.0f, 1/0.25f));
            // racket angled top left
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  2.0f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(40.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 1.0f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/1.0f, 1/0.25f));
            // racket horizontal top
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  1.0f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(50.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 1.5f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/1.5f, 1/0.25f));
            // racket angled top right
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  1.5f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(50.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 1.0f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/1.0f, 1/0.25f));
            // racket vertical right
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  1.0f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(40.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 2.0f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/2.0f, 1/0.25f));
            // racket horizontal bottom
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f,  2.0f * 0.1f, 0.0f));
            racket_transform_matrix =  tennis_rackets[item][1].cubeRotate(racket_transform_matrix, glm::vec3(90.0f, 0.0f, 0.0f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.25f, 2.75f, 0.25f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.25f, 1/2.75f, 1/0.25f));

            //net
            racket_transform_matrix = tennis_rackets[item][1].cubeTranslate(racket_transform_matrix, glm::vec3(0.0f, 0.0f, -2.25f * 0.1f));
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(0.1f, 2.5f, 0.1f));
            tennis_rackets[item][1].drawCube(racket_transform_matrix);
            racket_transform_matrix = tennis_rackets[item][1].cubeScale(racket_transform_matrix, glm::vec3(1/0.1f, 1/2.5f, 1/0.1f));

            for (float j = 0; j < 6; j++) { ]
content_copyCOPY