webjeff 241 Report post Posted August 17, 2004 Hello guys, OK, I did some research but all I could find was 2d arc equations. I need a 3d arc, like if I were to throw a ball to a location with a supplied force. Does anyone have any way to do this or is there a built in DirectX function that helps? Thanks Guys. Jeff. 0 Share this post Link to post Share on other sites
nts 968 Report post Posted August 17, 2004 i dont know what equation you have but couldn't you just convert this into one with a 3D vector instead of a 2D one. Just one more component to keep track of.btw try the math & physics forum 0 Share this post Link to post Share on other sites
Daerax 1207 Report post Posted August 17, 2004 This can get pretty difficult depending on how much of a range of motion your projectile will have. In the simplest case 3D projectile motion is the same as 2D projectile motions, you simply "lock" or ignore one of the planes.If you define you coordinate system like so:y/|\ / Z | / | / |/_______\ / xy(t) = ^{1}/_{2}at^{2} + vsinθt + y(0)x(t) = vcos(θ)t + x(0)z{t} = 0 Here you see I have set the motion in the z plane as zero, in the x plane there can be such factors as wind and in the y plane there is gravity. How you define the vector v is up to you. If you wish for a projectile that can basically waggle in all 3 dimensions then you can either define your vector in terms of 2 angles or explicitly operate on each vector component.In 3D the motion vector r is described by r = xx + yy + zz , where x, y and z are unit vectors and x, y and z are functions which describe the motion in their respective coordinates. If you have that ^{dx}/_{dt} = a_{x}t + v_{x0} then you will have your change in position in the x dimension. This can be extended to the other dimensions ^{dy}/_{dt} = a_{y}t + v_{y0 }and^{ dz}/_{dt} = a_{z}t + v_{z0}.(Note that this implies that the change in motion in general will be the sum of the change of motion in each coordinate: ^{dr}/_{dt = }^{dx}/_{dt}x + ^{dy}/_{dt}y +_{ }^{dz}/_{dt}z). If you take a step back and define everything in terms of vectors you compactify the operation and everything becomes simpler. r = r_{0} + ^{dr}/_{dt} = r_{0} + at + v_{0} . How you fill each of the vectors (I will define them as [x y z]) is up to you. If you have a = [0 9.8 0], v = [0 0 0] and r_{0} = [0 0 0] then you will have standard projectile motion. Making v = [4 0 0] will give a velocity in the x direction. One can easily incorporate momentum and Force for calculations of velocities and accelerations.[Edited by - Daerax on August 17, 2004 9:57:27 PM] 0 Share this post Link to post Share on other sites
Daerax 1207 Report post Posted August 17, 2004 A few corrections and an optional method. I just realized I had r0 instead of r in the equation of motion. It should be r = r + ^{dr}/_{dt} = r + at + v_{0}. Also if we integrate we can work back to the famous projectile motion equation ∫dr = r = ^{1}/_{2}at^{2} + v_{0}t + r_{0}. 0 Share this post Link to post Share on other sites