**0**

###
#2
Crossbones+ - Reputation: **4875**

Posted 02 September 2012 - 03:41 PM

Jason Zink :: DirectX MVP

Direct3D 11 engine on CodePlex: Hieroglyph 3

Direct3D Books: Practical Rendering and Computation with Direct3D 11, Programming Vertex, Geometry, and Pixel Shaders

Articles: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article (original):: Fast Silhouettes Article

Games: Lunar Rift

###
#3
Members - Reputation: **1543**

Posted 03 September 2012 - 01:39 AM

(*) All you need is your initial velocity vector

**v**(magnitude = how strongly you throw; orientation = which direction and under what angle you throw), initial position vector

**p**(the grenade position in the player's hand) and a constant gravity acceleration vector

**g**. Then each frame you just update the velocity and position vectors:

**v**+=

**g*** dt

**p**+=

**v*** dt

where dt is the time span between frames and the operations are vector operations.

**Edited by Tom KQT, 03 September 2012 - 01:39 AM.**

###
#4
Crossbones+ - Reputation: **8352**

Posted 03 September 2012 - 07:18 AM

(*) All you need is your initial velocity vector v (magnitude = how strongly you throw; orientation = which direction and under what angle you throw), initial position vector p (the grenade position in the player's hand) and a constant gravity acceleration vector g. Then each frame you just update the velocity and position vectors:

v += g * dt

p += v * dt

where dt is the time span between frames and the operations are vector operations.

**Edited by Bacterius, 03 September 2012 - 07:24 AM.**

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

- *Pessimal Algorithms and Simplexity Analysis*