0
\$\begingroup\$

Im working on expanding my camera class, but having trouble defining camera/view space in the manner of this diagram: enter image description here

What Im trying to achieve is to define the camera as a true object much like a person. Blue represents world space that we are used to especially in terms of positioning objects in a world. Furthermore, to put it in a real world perspective, world space is no different than the real world constants of North, South, East, West and the yaw of the camera currently corresponds to these directions.

Red is what the end goal is that I'm trying to solve. In relation to world coordinates, the yaw of the camera has a value of 45 degrees. In relations to the real world the camera is pointing Northeast.

Issues with the current state of the camera to the world: If an object was placed at -1, 1 (upperleft), the camera will see the object at an angle 315 degrees arbitrarily to the orientation of the camera.

In the end, how do I localize the degrees for the yaw in relation to the camera as show in red?

\$\endgroup\$
  • \$\begingroup\$ Wouldn't (0, 1) be 315°? Not (-1, 1)? \$\endgroup\$ – user1118321 Apr 24 '16 at 5:24
  • \$\begingroup\$ @user1118321 You are mixing world with camera space. And no, because as it is right now, the yaw of the camera still factors in world space, when it shouldnt. It is still depending on world space. The camera's yaw should always be zero in the direction it is facing, just like regardless of the direction you are face, your front is constant just like North is always North in the real world. A better question is "What is the angle of the object in relation to the camera direction (not the world)?" See the difference? \$\endgroup\$ – ChocoMan Apr 24 '16 at 5:46
  • \$\begingroup\$ Ah, I see. That makes more sense. Thanks for the clarification. \$\endgroup\$ – user1118321 Apr 24 '16 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.