Quantcast
Channel: AR/VR (XR) Discussion
Viewing all articles
Browse latest Browse all 12131

Stretching sprite to fit screen

$
0
0
I am trying to stretch a sprite to fit the screen. The sprite is at local position (0, 0, 0.4) and parented under the main camera together with the left and right VR cameras.

Code (CSharp):
  1.  
  2.        Camera leftCamera = GameObject.Find("Main Camera Left").GetComponent<Camera>();
  3.         spriteRenderer = GetComponent<SpriteRenderer>();
  4.  
  5.         transform.localPosition = new Vector3(0, 0, 0.4f);
  6.    
  7.        //Frustum size at distance transform.localPosition.z from the camera.
  8.         float...
Stretching sprite to fit screen

Viewing all articles
Browse latest Browse all 12131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>