Ok, what would I do if...
I have an object with an x coordinate and a y coordinate. When I press D, camera rotation is increased by 5 and A camera rotation is decreased by 5. The object will rotate around 0,0 according to rotation.
need any more information? If not, please figure out how to do this purely with math (no cheating with go to, point towards, move and go back kind of thing)
Offline
you mean use trig? Just have an angle that's set to point towards the center. As that variable is increased, his direction should also, so you simply need:
x=sin(direction) * distance wanted
y=cos(direction) * distance wanted
If this what you meant, then great! But I don't think it is, so could you elaborate?
Offline
Ok, here's what I want....
Basically, I have a set point, let's say it's 0,0:
<point>
Now I have an object.
<object>
-
-
---------------<point>
Now if I press A,
<object>
-
------------------------------------<point>
Object rotates around point, remaining at the same distance.
Offline
You mean orbit? What if you just move that center cross thing to the point you want it to orbit around
Offline
I want to do this just with math.
Offline
Yes, like that.
Just too lazy to do math today.
Offline
I just want a really simple thing without any moving around, just orbiting around a center. Must use an original x/y position and a formula to calculate where it goes (not just simply moving a certain distance away from origin).
Yes, yes I am really, really tired today.
Offline
Jens has a project that demonstrates what I think you're describing, but the math is insane, I would never try to replicate it!
Offline
Taneb wrote:
For a given orbited point (oX,oY), distance above the orbited point (h), and distance from the orbited point(d), the co-ords for the orbiting object are (oX±√(d²-h²),oY+h) and the angle is asin(H/d).
I think.
I'm guessing I have to do something with distance?
And anyone know how to find the cube root of something?
Offline
juststickman wrote:
Taneb wrote:
For a given orbited point (oX,oY), distance above the orbited point (h), and distance from the orbited point(d), the co-ords for the orbiting object are (oX±√(d²-h²),oY+h) and the angle is asin(H/d).
I think.I'm guessing I have to do something with distance?
And anyone know how to find the cube root of something?
Offline