Porabilic motion of a projectory

Blitz3D Forums/Blitz3D Beginners Area/Porabilic motion of a projectory

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Chad:
I think you mean "Parabolic motion of a projectile". :-)

Octo:

No, no, no! Constant rotation will give you a circular arc and will yield highly unrealistic effects (especially if you shoot straight up!)



He's not telling him to...

...oh wait, he is.

WolRon:
You shouldn't use MoveEntity. You should use TranslateEntity.

First you translate your gun's normal into global space like so:
TFormNormal 0, 0, 1, Gun, 0

Then you multiply that normal by the speed of your projectile:

Bvx# = TFormedX() * BulletSpeed#
Bvy# = TFormedY() * BulletSpeed#
Bvz# = TFormedZ() * BulletSpeed#

Then each frame, you multiply 9.8 by the number of seconds that that frame took to render, (Secs#) and subtract the result from Bvy#.

Finally, you move the bullet with translateentity each frame, like so:

Translatentity Bullet, Bvx#*Secs#, Bvy#*Secs#, Bvz#*Secs#

Oh, and use AlignToVector Bullet, Bvx#, Bvy#, Bvz#, 3 to align the bullet's Z axis with the direction it is traveling in.