Camera Systems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jajjo
    New Member
    • May 2009
    • 26

    Camera Systems

    Hey there.

    I have made a new camera system and I'm having a sort-of issue.

    The attached image (Untitled.jpg) will be the image I refer to when I say pink, orange, green or whatever. The black square is my camera and the gray square is a cube that I created to test the camera with.

    The image (Untitled2.jpg) is the result of rotating the camera around the X axis by 45 degrees.

    I am concerned, because I would expect the cube in Untitled2 to be coming into the frame from the bottom of the screen. When I rotate the camera around the X axis by 45 degrees I'd expect it to follow the pink line. It's not doing that and seems to be following the orange line.

    I think I'm missing a step in the creation of the camera. Or I'm not doing something. It's odd. It's like the camera is facing down the blue line. What am I missing?

    Thanks for any help and I can provide more info if necessary.
    Attached Files
  • Jajjo
    New Member
    • May 2009
    • 26

    #2
    Ok. I sorted it.

    Turns out I forgot that using cameras requires you to use the opposite sign for the direction you want.

    I was actually moving my camera below the cube, which is where all the odd behavior came from.

    Everything is working now.

    Comment

    • Jajjo
      New Member
      • May 2009
      • 26

      #3
      Ok, I have a new problem.

      Currently the mouse coordinate returns the position at the blue dot being 0, 0. How do I make it so that the 0, 0 is at the GREEN dot?

      I'm currently getting the cursor position with GetCursorPos() and then subtracting the windows x and y position from the cursors current x and y position.
      Attached Files

      Comment

      • Jajjo
        New Member
        • May 2009
        • 26

        #4
        Never mind.

        Sorted it again.

        Got the cursor position with GetCursorPos(), then used ScreenToClient( ) to convert it from screen coords to the client area coords. Worked perfectly.

        Comment

        Working...