i just have a regular camera class
and i cant seem to get any correct camera angles between the world and camera view besides the z axis which is my rotation angle from left to right
i just have a regular camera class
and i cant seem to get any correct camera angles between the world and camera view besides the z axis which is my rotation angle from left to right
What is a "regular camera class," and how does it differ from other camera classes that we may have used that are not "regular?"i just have a regular camera class
Or you could just explain how your camera class works.
see how this is only using a simple sin and stuff
it makes getting angles very hard
and i even read that is not reliable either
void RotateView(float speed) {
camera.view[1] = (float)(camera.pos[1] + sin(speed) * camera.vector[0] + cos(speed) * camera.vector[1]);
camera.view[0] = (float)(camera.pos[0] + cos(speed) * camera.vector[0] - sin(speed) * camera.vector[1]);
}
You also need to explain what it is you want the camera to actually do that you're having trouble with.
And USE PUNCTUATION! Periods, sentences, paragraphs. Maybe the reason you don't have a lot of "views" is because it's hard to read what you're writing.
you know that was totally a runon sentence?
but overlooking that unintentional mishap. i believe i have already expressed the issues i am having with my camera class, which are: that i am unable to easily calculate the x rotation angle which keeps flipping values, as i can the z rotation angle that doesnt;
What do you mean by "the x rotation angle"? What space are you trying to rotate about the X axis? And what exactly are you rotating: the camera's position, the camera's view target, or something else entirely?that i am unable to easily calculate the x rotation angle which keeps flipping values, as i can the z rotation angle that doesnt;
How exactly are you trying to control the camera's position and orientation? That's the part I don't understand. You posted a few lines of code that compute two components of "camera.view", but you don't explain what "camera.view" is or how it gets used. Are these values passed to gluLookAt? Are they used by your own matrix generation code?