Search Unity

Help with getting world coordinates to photo capture pixels

Discussion in 'VR' started by CuriousBeing, Jul 25, 2017.

  1. CuriousBeing

    CuriousBeing

    Joined:
    May 24, 2017
    Posts:
    2
    My goal is taking a picture (using the PhotoCapture class) of game objects and getting the world coordinates of the game objects and translate it to pixel coordinates on the image output from the PhotoCapture class.
    I tried using "camera.WorldToScreenPoint()" but this function gives coordinates that are not accurate.
    I also tried using "ScreenCapture.CaptureScreenshot(filePath)" in order to use "camera.WorldToScreenPoint()" but I get error on "ScreenCapture.CaptureScreenshot()" function.

    I am a newbie. Any help would really help a lot!

    Thanks!
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Are you trying to take a picture that aligns with the world?
     
  3. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
  4. CuriousBeing

    CuriousBeing

    Joined:
    May 24, 2017
    Posts:
    2
    Thanks for the reply!

    My goal is to create at least 4 points using game objects then crop the picture inside the area of the points as a result, disregarding their difference in distance from the camera.

    Thanks for the reply!

    I see, Yes! I think it has some similarities with what I want to achieve. I will take a closer look on the link you posted.
     
    Last edited: Jul 26, 2017