You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
I'm trying to implement 3rd person camera for a vehicle and I ran into problems calculating the right angle. I did some testing and found out that I'm getting the wrong rotation values of a node on the Y axis (up).
aha! I see it. change your cout line to-
std::cout << "ROT= X: " << r.X << "Y: " << r.Y << "Z:" << r.Z << std::endl;
X and Z are flipping between 0 and 180, which makes sense I guess. you're getting the transformation in 3d but setting the rotation in 2d. I guess I'd transform a vector with the matrix, then work out the angle 2d trig
The problem is that for 180 degrees it shows the car from the back (as it should) and the rest of the 180 degrees it shows it from the front.
I guess during the first half round I should be adding the camRot (as it's currently done) and substract it the other half but I haven't managed to figure out when is it the first half and when the other so no luck.
I should also say that I'm a bit new to matrixes and 3d vectors
doh! i guess if we don't get matrices we shouldn't mess around with them.
use another matrix for the rotation instead of messing with the existing one.