View Single Post
  #8  
Old 07-06-2006, 04:56 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by Luigi203
How about bringing some PRODUCTIVITY to your posts?
Not allowed linking to external sites!

Quote:
verticalspeed = sin(zangle)*s
verticalspeed -= .1 every .05 seconds
horizontalspeed = cos(zangle)*s
x = x + cos(angle)*horizontalspeed
y = y - sin(angle)*horizontalspeed
z = z + verticalspeed

zangle = -pi/10
initial z = 8
initial x = 0
initial y = 0

I need it so when z = 0, x,y = finalx,finaly
z = 0, x = finalx, y = finaly
Solve for T:
PHP Code:
fy vt 1/gt^2
gt
In the case of Graal
With v decreasing every 0.05 seconds of 0.1... It means the velocity is...

v = sin(zangle)*power + 2t

Now...

PHP Code:
v(0)1/g(0)t^2
sin(zangle)*power t^
Using the Pythagreom Theorum:
PHP Code:
= (-+- (b^4AC)^0.5)/2A
= (-sin(zangle)*power +- ((sin(zangle)*power)^4*y)^0.5)/2
This gives you two t's... Usually, there are two ways to reach a point using this... One is going very high up, and falling short... Or... Going very low, and very far... The higher up one takes longer for the same location ( more distance to cover ).

Now that you got t...

You can solve your location you want by...

PHP Code:
fx sin(angle)*t
fy 
cos(angle)*
But! Because Graal coordinates go from 0 to 64, and no 64 to 0... It means your grid is inversied...

PHP Code:
fy cos(angle)*
=] And you know where the projectile should land....


This is inaccurate in the sense that the speed is decreased only every 0.05 seconds, and so, the accelleration is actually an step-function. This means that for the period of 0-0.05, it decreases in an instance, rather than gradually, like in real life. It also means that it has the possibility to be off, but... Not by much.


; That's off the top of my head. I didn't check if I made mistakes.

Last edited by Novo; 07-06-2006 at 05:14 AM..
Reply With Quote