Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bs.astro: Add astronomy module #14

Open
TretinV3 opened this issue Aug 7, 2022 · 4 comments
Open

bs.astro: Add astronomy module #14

TretinV3 opened this issue Aug 7, 2022 · 4 comments
Labels
✨ Module New modules

Comments

@TretinV3
Copy link

TretinV3 commented Aug 7, 2022

Put the rotation of an armor stand/other so that it looks/points at the sun/moon

@TretinV3 TretinV3 added the ⚡️ Enhancement Improvement of an existing feature label Aug 7, 2022
@VForiel
Copy link
Member

VForiel commented Aug 7, 2022

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 link module, 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 using glib.link:create_link_ata and then run in a loop glib.link:keep_local_location. ⚠️ My last tests on this module showed some bugs, so maybe it will not work properly.
  • Using glib.vector and glib.move modules 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 using glib.move:by_vector

Good luck! 🤣

If you want help, do not hesitate to ask! ;)

@TretinV3
Copy link
Author

TretinV3 commented Aug 7, 2022

I don't want gravity I want an observatory

@VForiel
Copy link
Member

VForiel commented Aug 7, 2022

Oh ok, sorry I read too fast haha ^^'

@VForiel
Copy link
Member

VForiel commented Aug 13, 2022

@ascpial got another idea to create a real astronomy module: being able to get the phase of the moon

@VForiel VForiel changed the title Rotation to moon/sun Add glib.astronomy module Aug 13, 2022
@VForiel VForiel self-assigned this Aug 13, 2022
VForiel added a commit that referenced this issue Nov 20, 2022
@VForiel VForiel removed their assignment Nov 29, 2022
@VForiel VForiel changed the title Add glib.astronomy module bs.astro: Ad astronomy module Feb 27, 2023
@VForiel VForiel added ✨ Feature New feature and removed ⚡️ Enhancement Improvement of an existing feature labels Feb 27, 2023
@VForiel VForiel added this to the Bookshelf milestone Mar 15, 2023
@theogiraudet theogiraudet added ✨ Module New modules and removed ✨ Feature New feature labels Sep 2, 2023
@VForiel VForiel added ✨ Feature New feature and removed ✨ Feature New feature labels Sep 17, 2023
@aksiome aksiome changed the title bs.astro: Ad astronomy module bs.astro: Add astronomy module Jan 16, 2024
@aksiome aksiome removed this from the Bookshelf milestone Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Module New modules
Projects
Status: ⏳ Todo
Development

No branches or pull requests

4 participants