Jon’s PhD Journal

April 13, 2007

Friday: so what is this velocity coordinate then?…

Filed under: Books, Notes — JDE @ 5:48 pm

After examining yesterday’s results in SAS, the data outputted by the simulation produced tuples of coordinates that represented a particular velocity, eg [20 30 40].  However, I must admit I was a bit confused what this number represented.  As such today I’ve been at the University of Hertfordshire’s library, looking through a number of programming games in 3-D books.  As such the notes from which are below:

  • From Beginning Math and Physics for Game Programmers, by Wendy Stahler:
    • In one dimensions, velocity is a positive or negative number where a sign indicates the direction required.
    • In two dimensions: displacement equals the final minus initial positions
    • n.b. vectors need to be in component form before they can be subtracted: distance in the x direction and distance in the y direction
    • for a diagram of this, see your notes on the 13th of April 2007
    • *velocity is displacement divided by time
    • n.b. polar coordinates like 10 m per second at 53°, whereas Cartesian coordinates like [ 6 8 ] represent a vector, where 6 and 8 represent the x and y coordinates of the vector respectively
      • The x component is equal to the magnitude multiplied by the angle’s cosine
      • The y component is equal to the magnitude multiplied by the angle’s sine
  • from Beginning 3-D Game Programming by Tom Miller:
    • again, see your notes the 13th of April 2007 for a figure indicating the difference between two different vectors
    • vectors measure both direction and velocity
    • most times a vector is defined as a free vector, which is when the root of the vecto is at the  origin
    • and therefore the arrowhead in the figure in your notebook indicates the [x,y,z]  vector value
      • drawing a line between this point in the origin therefore leads to the direction and the velocity of the two points
    • nb vectors do not need to be rooted at the origin, but it makes calculations easier
    • to calculate the velocity of a vector when you know the arrowhead coordinates, the length of the vector is equal to the square root of (x coordinate squared, + y coordinate squared, + z coordinate squared) — again see your notes for the written equation
    •  a normalised vector, otherwise known as unit vector, is a vector with a length equal to one: this means you can store direction without regard to the velocity
      • to calculate the normalised version of a vector, take each vector component and divide by the vector length
        • e.g. with a free vector of (23, 18, 7) the length this vector is approx 30 .0333
        • dividing each component by this number leads to a new vector with coordinates: (0.77, 0.60, 0.23): the length of this vector was approximately one, which is expected
  • from 3-D Game Programming with C++by John De Goes
    • you can describe the position of a three-dimensional object that is moving in a straight line by using its initial velocity, its initial position and its acceleration. Equation:
    • P(t) = P(0) – V(0)t + 1/2at^2, where:
      • P(t) point of the object
      • P(0) initial position
      • V(O) initial velocity
      • a acceleration
      • t time
    • this can be expressed equivalently for the x, y, z coordinates:
      • Px = P(x0) – V(x0)t + 1/2axt^2
      • Py = P(y0) – V(y0)t + 1/2ayt^2
      • Pz = P(z0) – V(z0)t + 1/2azt^2
    • this equation can also be useful:
      • V = V0 + at
  • Game Physics by David H Eberly
    • looked interesting but probably a little bit too much at this point
  • websites of interest:
    • gamedev.net
    • gamasutra.com

No doubt more will follow, and hopefully tomorrow will have the opportunity to do a bit more investigation in this area. 

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.