Bookshelf
Bookshelf copied to clipboard
`bs.environment`: get the moon phase
Put the rotation of an armor stand/other so that it looks/points at the sun/moon
There is already 3 ways to make it:
- Without Glibs: roate the armor_stand and TP the other one locally at the same position in a loop (using ^x ^y ^z coordinates). THen the second one will appear to orbit around the first one.
- Using the
linkmodule, which is basically the same, but it allow to adjust the distance, the angle etc. in short, you have better controle on the movement. To do so, you have to link the second entity to the first one usingglib.link:create_link_ataand then run in a loopglib.link:keep_local_location. ⚠️ My last tests on this module showed some bugs, so maybe it will not work properly. - Using
glib.vectorandglib.movemodules to create a realistic (but also very complex) gravity. You can define an initial vector for the second entity wich represent the tangential speed, define a mass for the two objects (or only the second one if you want the first one to be fixed) and then in a loop, you apply the gravity formula to simulate the acceleration : v = G*M/r^2 * s (with v the new speed vector, G the gravitational constant, M the mass of the attractive body, r is the distance vector between the two objects and s is the time spent before the last actualisation, so 1 tick, so 0,05 second). Once you have this new vector v, you add it to the previous one and you apply the movement usingglib.move:by_vector
Good luck! 🤣
If you want help, do not hesitate to ask! ;)
I don't want gravity I want an observatory
Oh ok, sorry I read too fast haha ^^'
@ascpial got another idea to create a real astronomy module: being able to get the phase of the moon
We will do:
- Moon phase detection
- Rotation to the moon or sun