Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

scale of objects calculated according to the screen

Discussion in 'ARCore' started by joaovictorpac, Jun 10, 2018.

  1. joaovictorpac

    joaovictorpac

    Joined:
    Jun 10, 2018
    Posts:
    3
    How to maintain the calculated scale of objects calculated according to the screen size of the device? I would like to make a process that suits any mobile device on which the app was installed. That is, I need a way to identify the size of the device screen and calculate the scale of the object to be represented in augmented reality. Does anyone know if it is possible? Can someone help me? I'm using arcore, but I also use vuforia.
    .
     
  2. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    21
  3. UnityEngineer_India

    UnityEngineer_India

    Joined:
    Jan 25, 2012
    Posts:
    22
    r you asking for the 3D object size or 2D UI size.?
     
  4. bradweiers

    bradweiers

    Unity Technologies

    Joined:
    Nov 3, 2015
    Posts:
    40
    Here is my recommended solution:
    • Get the position where the scaled object will appear or will be placed
    • Cast a ray from that location upwards, looking for a frustum plane
    • Take that distance and translate it to the height of the object and scale it so that height < ray hit distance
    Let me know if that helps