- #1
MstWntd
- 7
- 0
Intro:
Hello, I have spent the last four or so days searching google and this forum and as rich as both are in information and helping. I have found it very hard to get anywhere.
Basically I haven't done any Maths/Physics related courses and as a result I am totally stumpped on my Games Technology Coursework.
Problem:
I am building a 3D game in C++ using OpenGL. I use a Bow and Arrow in this game.
I need to calculate the arc the Arrow will make, the maximum height it will reach, at what time (in milliseconds) it will hit the target.
By arc I mean, I would need to calculate its new X, Y and maybe X Rotation over the time its traveling.
So then I can render the Arrow in its new coorodinates, thus giving it the apperence of flight.
I hope I am making sense!
Attempted Solutions:
Suppose that the projectile starts at (0,0).
Suppose that the initial velocity of the projectile is v0.
X is the horizontal direction, and Y is the vertical direction.
Then, the distance in the x and y direction over time t is:
[tex]x(t) = (v_{0} cos q) t[/tex]
[tex]y(t) = (v_{0} sin q) t – (gt^{2})/2[/tex]
The above is supposed to give me the new X and Y values. I can't seem to work it properly.
Either the equation is wrong or my Game World has warped coordinates, I am so ill-experienced I can't even tell!
It might help if I understood the equation more. Also the course head will be checking our physics "engine" tommrow
I have an equation for the Maximum height as well..
[tex]Maximum Height = (v_{0}2 sin2 q )/ (2g)[/tex]
I don't understand the sin2 thing, do we square the sin of q?
Thats all I have, any help is appricated.
Hello, I have spent the last four or so days searching google and this forum and as rich as both are in information and helping. I have found it very hard to get anywhere.
Basically I haven't done any Maths/Physics related courses and as a result I am totally stumpped on my Games Technology Coursework.
Problem:
I am building a 3D game in C++ using OpenGL. I use a Bow and Arrow in this game.
I need to calculate the arc the Arrow will make, the maximum height it will reach, at what time (in milliseconds) it will hit the target.
By arc I mean, I would need to calculate its new X, Y and maybe X Rotation over the time its traveling.
So then I can render the Arrow in its new coorodinates, thus giving it the apperence of flight.
I hope I am making sense!
Attempted Solutions:
Suppose that the projectile starts at (0,0).
Suppose that the initial velocity of the projectile is v0.
X is the horizontal direction, and Y is the vertical direction.
Then, the distance in the x and y direction over time t is:
[tex]x(t) = (v_{0} cos q) t[/tex]
[tex]y(t) = (v_{0} sin q) t – (gt^{2})/2[/tex]
The above is supposed to give me the new X and Y values. I can't seem to work it properly.
Either the equation is wrong or my Game World has warped coordinates, I am so ill-experienced I can't even tell!
It might help if I understood the equation more. Also the course head will be checking our physics "engine" tommrow
I have an equation for the Maximum height as well..
[tex]Maximum Height = (v_{0}2 sin2 q )/ (2g)[/tex]
I don't understand the sin2 thing, do we square the sin of q?
Thats all I have, any help is appricated.
Last edited: