Announcement

Collapse
No announcement yet.

A problem of deproject

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A problem of deproject

    Hi,
    I'm look for a method to make my pawn rotates its head to follow my finger when I touch and slide. This requires a calculation of the angle between the pawn and the 3D location of my finger. I tried to use deproject feature, as in the following picture. The problem is I cannot find any reference for these problems:
    1. What decides the distance between "PlayerViewPoint" and Screen?
    2. Is the "PlayerViewpoint" right in the middle of Screen, and does this location equals to PlayerCamera.Location?
    Thanks a lot!

    Attached Files

    #2
    the FOV and AspectRatio.
    By using basic trigonometry you can compute tha distance if you know the height/width of the screen, or easier yet, if they are treated on the [-1..1] range.

    Comment


      #3
      Oh, yup. That's what I want. Thanks a lot. I'll take a look in.

      Originally posted by login View Post
      the FOV and AspectRatio.
      By using basic trigonometry you can compute tha distance if you know the height/width of the screen, or easier yet, if they are treated on the [-1..1] range.

      Comment


        #4
        Erm what? The playerviewpoint is literally the players eyes, you don't determin the distance between his screen and his eyes. The image is just an example to show what deproject does.

        Comment


          #5
          Yes. I've solved my problems however.
          Although it's still a puzzle how to get "the distance between screen and eyes". I do think it will be funny when you put on a first-person game and control something on screen based on distance. hehe, just for fun.


          Originally posted by Graylord View Post
          Erm what? The playerviewpoint is literally the players eyes, you don't determin the distance between his screen and his eyes. The image is just an example to show what deproject does.

          Comment

          Working...
          X