Processing & OpenGL - Changing the camera position?

If you have got direction vector, you can set position of your camera as follow (abstract code).

If you have got direction vector, you can set position of your camera as follow (abstract code): pos += speed * normalize( direction ); That's for moving forward. If you wanna move backward - just multiply your normalized direction vertor by -1. For strafing left and right, use something this: pos += speed * normalize( cross_product( direction, upvector ) ); // strafing right pos += speed * normalize( cross_product( upvector, direction ) ); // strafing left Here are some notes on vector operations (from one of my "World" applications =) ): normalize( vec ); returns vec, which length equals to 1; this one "cuts" vec to needed length cross_product( vec_a, vec_b ); returns vec_c, which is directed perpendicullary to vec_a and vec_b (see this article for more).

My version of cross_product() looks like this: Vector Vector::CrossProduct(const Vector &v) { double k1 = (y * v. Z) - (z * v. Y); double k2 = (z * v.

X) - (x * v. Z); double k3 = (x * v. Y) - (y * v.

X); return Vector(NumBounds(k1), NumBounds(k2), NumBounds(k3)); // NumBounds(v) returns 0 when v is less than 10 ^ -8 } Hope this will help =).

I think by far the easiest thing to do would be to use the peasycam library mrfeinberg.com/peasycam/ this library will give you access to your camera using a mouse which you can constrain in various ways as well various getters that make it easy to access information about the camera and its current state.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions