If we look at the green bar we see that its real height is 2/3 of its shadow. So that means we need to find 2 shadows length for the red bar, the uninterruped part and the one on the wall. Since we now know the formula for the floor shadow - real height is 2/3 of it - meaning the part that makes that shadow is 4 meters long. Then we have to add the part on the wall which is straight up, it has no formula so we just add those 4 meters on the wall to the 4 meters we got from multiplying 2/3 by 6 meters and we have 4 meters + 4 meters = 8 meterss
The key to this riddle is realizing that you do not have to pull the emergency switch in the first room, the entrance, and so that room will not lock down. You can leave it, and then return to it and go out the other door. And indeed this is exactly what you need to do so you can hit all 16 rooms and end in the exit room.
Once you know to leave and reenter the first room, there are eight possible solutions to travel through all the rooms and end at the exit. Because the first room is clear, you can backtrack through it to get back on the right track and pull the emergency switch in every room, saving the world from agonizing death by ancient virus.