I am writing an opengl based iphone app and would like to allow a user to translate around a view based on the direction that they move two fingers on the screen. For one finger I know I could just calculate the vector from the start position to the current position of the users finger and then find the unit vector of this to get just the direction, but I don't know how I would do this for two fingers, I don't think adding the components of the vectors and calculating the average would work so I'm pretty much stuck.
Vector math works just like you think:
v3 = (v1 + v2)/2
// so:
v3.x = (v1.x + v2.x) / 2;
// same for Y and Z
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With