Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Creating planetary orbits using MAX expressions
show user profile  lordraidis
So I've been doing some meddling around with old-school MAX expressions in hopes that I can recreate planetary simulations with a reasonable degree of accuracy. "What's the big deal?" you ask... "Just create a sphere with a path constraint and attach it to an ellipse shape." Well this method fails to take into account the gravitational effect where orbiting bodies speed up slightly when they approach their perihelion (closest point) and slow down at the aphelion (furthest)

example: http://www.youtube.com/watch?NR=1&feature=endscreen&v=RtIm4N-P_ys

Anyway, I've been working on this problem for some time and can't seem to crack the math needed for it. This is what I have so far:

...which produces this:

The blue ball has the expressions attached to it. The small white ball (inside) is a simple path constraint. Basically what I want to do here is make the blue ball speed up as it approaches the yellow ball (the "sun" I suppose) and make it slow down a little during the period when it's furthest away. I attempted to use the yellow sphere's distance as a function using a ExposeTransform node object, but it doesn't allow me me to do it because of dependency loop issues. Are there any physics buffs here who can help me figure this out? I am not a scripter or a mathematician, but I know just enough to get by. Please help!!! I feel like Kepler trying to figure out calculus using a ruler and thumb-tack....This thing is driving me mad...

read 341 times
12/10/2011 2:01:22 AM (last edit: 12/10/2011 2:01:59 AM)
show user profile  lordraidis
Ok, the solution to this problem was answered on another board. Here it is:

"Hi,
Create elliptical spline shape around sun, add path constraint to planet to wire it to this shape and assign float expression controller to Percent property. Use this expression:

(F/turn)+(multiplier*sin(F*(360/turn)))

where "turn" = frames for one turn around sun and "multiplier" = multiplier for acc/brake addon (use 0.1 for start)"

Here's what I ended up using:

(F/100)+((.12)*-sin(F*(360/100)))

The result:

Anyway, figured this might help somebody else :)
read 329 times
12/10/2011 4:33:26 AM (last edit: 12/10/2011 4:33:26 AM)
show user profile  Garp
Kepler's laws

Good luck with law #2!




read 322 times
12/10/2011 7:18:45 AM (last edit: 12/10/2011 7:18:45 AM)
#Maxforums IRC
Open chat window


Support Maxforums.org