planet orbit alg
Blitz3D Forums/Blitz3D Programming/planet orbit alg
| ||
Hi I'm trying to get a sphere to move around another sphere but I cant get the algorythm, I've tried sin and cos but it's not the same as 2D, any ideas? Thanks. |
| ||
Create a pivot; Position the pivot in the inner sphere; Parent the outer sphere to the pivot; and Rotate the pivot every frame. |
| ||
Yeah I knew you could do that, but I really could do with the algorythm :) |
| ||
Something like:;Distance between planets Dist# = 100 ;position of planet 1 X1#=0 Y1#=0 Z1#=0 For A = 0 to 359 ;position of planet 2 X2#=Cos(A) * Dist + X1 Z2#=Sin(A) * Dist + Z1 RenderWorld() Flip Next |