Browse Search Popular Register Upload Rules User list Login:
Search:
Script Problem Help.

Image:
screenshot of the scene

Author: Physics A

Group: Default

Filesize: 5.15 kB

Date added: 2023-07-19

Rating: 5

Downloads: 492

Views: 230

Comments: 13

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

I need help with a project on relativity. For this, I had to code something rather complex. However, I realized that the level of programming required exceeds my skills using Algodoo. That's why I'm reaching out to experienced individuals to assist me in completing my project. Here's the problem: the green circles should be attracted by the gravity of the red circle. However, the red circle isn't actually at its position on the screen but rather 20 meters behind. The green circles would experience gravity as if the red circle were positioned 20 meters behind its actual location. Consequently, the green circles would move towards the direction of the past position of the red circle.

If that's not precise enough, please let me know, and I'll explain my project to you from A to Z. I can also show you the formulas that can assist you. Once everything is ready for publication, I will include your name in the description to express my gratitude for your help.
Please log in to rate this scene
edit
Similar scenes
Title: XRAY script problem
Rating: 5
Filesize: 6.06 kB
Downloads: 328
Comments: 5
Ratings: 1
Date added: 2023/12/26 19:22:12
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Le entry to ultra's contest
Rating: 5
Filesize: 40.73 kB
Downloads: 308
Comments: 2
Ratings: 1
Date added: 2015/09/05 03:12:35
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: I have a Problem!
Rating: 5
Filesize: 21.03 kB
Downloads: 445
Comments: 6
Ratings: 1
Date added: 2016/12/12 17:24:17
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Simple Global Lighting Engine
Rating: 5
Filesize: 26.27 kB
Downloads: 326
Comments: 2
Ratings: 1
Date added: 2014/07/27 18:04:35
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Race complex... PLEASE HELP!!
Rating: 5
Filesize: 109.32 kB
Downloads: 490
Comments: 5
Ratings: 1
Date added: 2010/04/18 18:50:06
Made with: Phun
Rating: rated 5
download
Title: Script Canon V2.1 (updated)
Rating: 5
Filesize: 17.64 kB
Downloads: 509
Comments: 0
Ratings: 1
Date added: 2009/08/27 20:56:35
Made with: Phun
Rating: rated 5
download
I'm not certain if I can do what you are asking but I will take a look at it. First of all, I need to make certain that I understand what you mean by "behind". Algodoo is a 2D simulation program, but there are ways to simulate 3D scaling and translation. Normally objects move left, right, up, and down, but there are ways to make them appear to move in and out (closer to the viewer and further away from the viewer). So, when you say you want the red circle to be 20 meters behind the green circles, you want it to be away from the viewer, further into the scene which would make it look smaller because of perspective. Is that correct?
to the left, I mean, sorry.
The project I want to undertake is mathematically possible but complex, which is why I am seeking teamwork.
What I want to do is create a Doppler effect for gravity. Imagine a red circle moving at a certain velocity, generating a Doppler effect for gravity, as gravity propagates at the speed of light. If we were on the green circle, we would observe the past of the red circle as well as its gravitational effect from the past. This works in a similar way to galaxies. When we observe galaxies through a telescope, they are not actually where they appear in the photos because we are seeing their past. It depends on the distance between the observer and the emitter. Therefore, the closer the green circle is to the red circle, the less significant the apparent shift in the position of the red circle will be.
Well, to be honest, I understand the basic principles of what you want to do in a scene, but from your description, I believe my math abilities may not be sufficient enough to make it happen. There are a few other guys who use Algobox on a regular basis who are much better equipped than I am to undertake a math-intensive project. So, I will back away from it and hope that someone else would be so kind to offer his/her assistance. I will volunteer later if I believe I could help out in some way that my experience dictates.
Okay, but can you show me at least how to change the direction towards which the green circles will be attracted? Instead of falling towards the red circle, they will fall at a 30-degree angle to the left, as if the red circle were there?
HMMmmmm..... I don't believe that's possible with just the standard objects. Each object can have "Attraction" which can be thought of as their own gravity. Attraction magnitude is variable, and the field can be made linear or quadratic. Unfortunately, there's no way to vector the origin of the field to make it appear in a different location from the object. BUT there is a way that you can "fake" it. By placing another invisible object at some distance and angle from its parent object, you can simulate a gravity field that's located away from the parent. Maybe someone else has a better idea?
I believe that "Sim.gravityAngleOffset" allows for changing the direction of the gravity vector. However, if you're not familiar with coding, it's not a problem. I will try your idea.
Yes, I'm familiar with Thyme Script. I've been doing it for over ten years, but I don't know everything. For example, I did not know about "Sim.gravityAngleOffest". It's something I will certainly play with now that I know about it! :tup:
Wait.... I believe that only affects the Algodoo gravity field and does not have any effect on individual objects. I mean it doesn't change the attraction force of individual objects. So, that probably won't do what you are hoping it will.
Last edited at 2023/07/20 02:51:43 by Xray
look with this code that I don't understand, you will see it seems to modify the direction of the gravity force vector: postStep = (e)=>{
vel = vel + [ - math.sin(Sim.gravityAngleOffset), math.cos(Sim.gravityAngleOffset)] * Sim.gravityStrength * e.dt;
}
In the guide I'm looking at, the description for the Sim.gravityAngle code
Offset is: Direction of gravity in radians. Unlike other rotations, 0 is down.
There's a discussion in the Algodoo user Forum about "gravity pads". A gravity pad is a component that some of the Marble Race community uses in their marble race scenes. In fact the variable Sim.gravityAngleOffset is part of that discussion. You may be able to glean some understanding of this gravity angle offset if you read through that discussion. It's under the subject heading "Thyme Scripting".