Comments (4)
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 usingglib.link:create_link_ata
and 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.vector
andglib.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 usingglib.move:by_vector
Good luck! 🤣
If you want help, do not hesitate to ask! ;)
from bookshelf.
I don't want gravity I want an observatory
from bookshelf.
Oh ok, sorry I read too fast haha ^^'
from bookshelf.
@ascpial got another idea to create a real astronomy module: being able to get the phase of the moon
from bookshelf.
Related Issues (20)
- Unit test module HOT 7
- Add convention for shared entities and blocks
- Add back the spread function
- Error in `#bs.math:exp` with negative inputs
- Improve health module
- Prepare the 1.20.3 update HOT 1
- Fix preservation principle
- Add option to define Y coordinate in `bs.location:spread`
- Add option to manage the spread behavior HOT 1
- Replace `bs.loc.[x,y,z]` scores by `bs.in.[0,1,2]` ones in the `bs.location:add` function
- Create `bs.vector` score swapping
- Create `bs.location` score swapping
- Add `bs.vector:scalar_product`
- Add `bs.vector:cross_product`
- Add `bs.core:out_to_in/0-[1,2,3,4,5,6,7,8,9]`
- Add link to other libraries
- Add option to detect placed block
- Add a sidebar module for dynamic scoreboard sidebar
- A module for data transformation and validation
- `bs.log` & `bs.core` improvements HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bookshelf.