// Use this for initialization
    void Start()
    {
        _sphere = (SpriteSphereRenderer)FindObjectOfType(typeof(SpriteSphereRenderer));

        var height = 2f * camera.farClipPlane * Mathf.Tan(0.5f * camera.fieldOfView * DEG2RAD);
        var width = height * (float)Screen.width / Screen.height;
        var scale = new Vector3(width, height, 1f);
        normalView.transform.localScale = scale;
        normalView.transform.position = (camera.farClipPlane - 1e-3f) * camera.transform.forward + camera.transform.position;
        normalView.transform.forward = camera.transform.forward;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        _sphere = (SpriteSphereRenderer)FindObjectOfType(typeof(SpriteSphereRenderer));

        var height = 2f * camera.farClipPlane * Mathf.Tan(0.5f * camera.fieldOfView * DEG2RAD);
        var width  = height * (float)Screen.width / Screen.height;
        var scale  = new Vector3(width, height, 1f);

        normalView.transform.localScale = scale;
        normalView.transform.position   = (camera.farClipPlane - 1e-3f) * camera.transform.forward + camera.transform.position;
        normalView.transform.forward    = camera.transform.forward;
    }