First of all, what is the difference between get position and get absolute position?
If i have array of coordinates i want my webcam to follow, like this:
Turn Left -> 75%
Turn Right -> 30%
Turn Right -> 100%
Turn right - 60%
as 100% is either a full LEFT or full Right, in other words, a 100% Right mean to turn right 180 degree.
No the camera should turn left 75% degree of the 180, then after that it should turn right 30% of the 180 degrees, and again after the 30% rotation, it has to turn right again 100%!
How am i going to do that! any help please?
Need help in understanding FPS camera behaviour!
And i've forgot to mention, that the camera will always be going forward.
Code: Select all
int i = 0;
while(device->run())
i++;
camera->setPosition(0, 0, i);
...
...
...
Here are the following steps I've came up with so far!
As you can see, this is just a pseud code, that i can't translate into source code yet! ... any help please
Code: Select all
current = camera->getPosition(); // gets the camera's current position
camera->setRotation(0, R, 0); // sets the camera's direction along Y-Axis
camera->setPosition( current++) // Now move one step forward
Hybrid, thanks for your answer ... and now i've just got what getAbsolutePoistion does ...
And now for my main question, which is about after setting the Camera Rotation Value around the Y-Axis, how can i know the next coordinates, to set the camera position to it.
in other words:
First we need to get the camera current position by using camera->getPosition(), which will return X Y Z values.
Now we set the Rotation Value, by using: camera->setRotation(0, R, 0)
And Finally, we need to calculate the New X Y Z coordinates so we can set the camera to the new coordinates, by using camera->setPosition(newX, newY, 1).
I wrote the One value in the last setPosition(newX, newY, 1), because i assume the camera will be always moving forward.
So does anyone know how to calculate the newX and newY coordinates?
And now for my main question, which is about after setting the Camera Rotation Value around the Y-Axis, how can i know the next coordinates, to set the camera position to it.
in other words:
First we need to get the camera current position by using camera->getPosition(), which will return X Y Z values.
Now we set the Rotation Value, by using: camera->setRotation(0, R, 0)
And Finally, we need to calculate the New X Y Z coordinates so we can set the camera to the new coordinates, by using camera->setPosition(newX, newY, 1).
I wrote the One value in the last setPosition(newX, newY, 1), because i assume the camera will be always moving forward.
So does anyone know how to calculate the newX and newY coordinates?