-----------------------------------
sakura
Sun May 30, 2004 8:03 pm
Ball move in orbit
-----------------------------------
I was trying to move the ball in orbit..........
but i'm wondering if there's more efficient way than drawing it and erasing it everytime it moves
Thx a lot
-----------------------------------
SuperGenius
Sun May 30, 2004 8:20 pm
-----------------------------------
if you have oot 3.x you can use sprites but that version is pain in the ass because of no syntax colouring, some new commands are unsupported, and the fact that it just sucks.
-----------------------------------
AsianSensation
Sun May 30, 2004 8:47 pm
-----------------------------------
well, if you know the equation of the ball's movement, is it a circle? or an ellipse? You can just model the math behind it.
like x^2 + y^2 = r^2 and x^2/a^2 + y^2/b^2 = 1
sub values into those equations will be the easiest way of modelling orbits.
for drawing and erasing, it's the only way. Though if you have 4.0.3 or above, View.Update is good.
and 4.0.5 gives View.UpdateArea, which is even better.
-----------------------------------
Flashkicks
Mon May 31, 2004 8:08 am
-----------------------------------
Sensation; That is some very trippy stuff you got there..LOL.. i am going to play around with it and see if i can get anything to orbit. i have always wanted to make something orbit but never really understood the physics of how to actually PROGRAM it.. Maybe you could explain these numbers and whatnot.. . Would be nice. Either way- I shall go experiment :D
~Flashkicks
Okay- this is a few minutse later when i tried experimenting with those equations and I can NOT understand HOW they work.. i mean.. I dontthink first of all that i am typing NEARLY enuff code as to what may be needed- but then again even some of the most comlpex programs require little code.. This is what i have;
% "x^2 + y^2 = r^2" and "x^2/a^2 + y^2/b^2 = 1"
var x, y, r : int
x := 5
y := 5
r := 20
for i : 1 .. 20
r** = x** + y**
drawline (x, y, x + i, y + i, 12)
end for
Do you think you could help me with my coding or perhaps supply a sample of your own Working code??.. I know this thread wasnt my business or whatnot but I have been wondering about orbit for AGES now.. I dont really want to miss this chance to have someone explain to me how they work and the code for source and whatnot.. Anyhoo- Would be much appreciated....
~Flashkicks
btw- My Turing here at school doesnt recognize the "^" . Eg. x^2 .. hence; that is why i have "x**"