Recreating our Solar System in CoSpaces Edu seems to be very popular and we’ve seen many cool examples! Here is a way to make the planets orbit the Sun using Blockly.
You can use the ellipsoid from the “Building blocks” category for the Sun and the planets. Place the Sun in the middle of the scene and align all the planets to the left. Name the planets and enable them for Blockly.
In order to make a planet orbit the Sun, use the “turn” block (the one with the radius parameter) from the “Transitions” tab. Here, you need to use the appropriate value for the radius and specify the orbit time as well. Put the “turn” block inside a loop to make the planet orbit the Sun repeatedly.
This is a very simple example on which you can build and with a little bit of artistic effort you can go pretty far with your Solar System. You could use .obj models for your planets, build a nice background scene, use some arithmetic to get the ratio of the orbit times and size differences between the planets right etc.
I tried to use correct (relative) sizes and distances from the Sun once.
It turned out that you’re not going to see much except for the Sun. The size differences (Sun > gas planets > rocky planets) and distances are just too big. So eventually I scaled everything back in order to see my Solar System again But it was a nice learning experience!
You can use the “scale” block from the “Transitions” tab to set the sizes and in order to place the planets in correct distances you can use the “move to x y z” block.
Benny,
Thank you so much for this detailed tutorial on using Blockly with CoSpaces in this Solar System example. Consider consolidating this blog post into a more formal lesson for those of us who are new to both CoSpaces and Blockly. This blog post really helped me as a teacher to understand the mechanics of how CoSpaces and Blockly work together.
Looking forward to other beginner ‘how-to’ examples showing CoSpaces and Blockly working together!
Judy
Thank you so much
This blog post really helped me as a teacher to understand something new about blockly in CoSpaces .
I hope to see more examples about how to use the blockly code
my greeting
yes, this is “on update” block in “events” category. its body will be executed forever until you stop it using “stop update” block which is also in “events”