Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

rectangle box "parallax" rotate effect with gyroscope for android app

Discussion in 'Image Effects' started by jazzbach, Oct 29, 2021.

  1. jazzbach

    jazzbach

    Joined:
    May 11, 2016
    Posts:
    41
    Hello,

    I'm trying to do an app that uses the gyroscope to rotate a 3D environment (or the camera, whatever works better). The 3D environment is a simple box without the cap (only the inner part of the box is visible). I know there are some examples out there. However, what I'd like to do is to make sure that the camera near plane's four corners always match the four corners of the box, no matter how the user is turning the phone.

    I'm attaching an example of what I'm trying to do (what would happen if the user was rotating the cellphone):



    Maybe the solution is not as complex as I might think but right now I'm kind of clueless on how to approach this problem. Any help of link to more information will be really appreciated .

    Thanks beforehand !