1 直接打开插件里设置好的场景就好了!

unity打开htc vive 的前置摄像头 和 实现增强现实效果

 2 增强现实

-A 导入ARtookit 和HTC 的package

unity打开htc vive 的前置摄像头 和 实现增强现实效果

unity打开htc vive 的前置摄像头 和 实现增强现实效果

unity打开htc vive 的前置摄像头 和 实现增强现实效果

B,修改代码

 B1, ARControllerEditor

unity打开htc vive 的前置摄像头 和 实现增强现实效果

//wangpeng edit 20170512
       arcontroller.eyeCam = EditorGUILayout.ObjectField(arcontroller.eyeCam, typeof(GameObject), trueas GameObject;
        //end

B2, ARController.cs

unity打开htc vive 的前置摄像头 和 实现增强现实效果

//wangpeng edit 20170513
    public GameObject eyeCam;
    //end

unity打开htc vive 的前置摄像头 和 实现增强现实效果

      vbmgo.transform.parent = eyeCam.transform;
        vbmgo.transform.position = new Vector3(0.0f0.0f1.5f);
        vbmgo.transform.rotation = new Quaternion(0.0f0.0f0.0f1.0f);
        vbmgo.transform.localScale = new Vector3(2.5f2.5f2.5f);
        //end 

B3, ARCamera.cs

unity打开htc vive 的前置摄像头 和 实现增强现实效果


private Rect initRect = new Rect(0,0,1,1);

unity打开htc vive 的前置摄像头 和 实现增强现实效果

 c.   clearFlags = CameraClearFlags.Skybox;

unity打开htc vive 的前置摄像头 和 实现增强现实效果


      this.GetComponent<Camera>().rect = initRect;
        //end

 

C, new material and Render Texture

unity打开htc vive 的前置摄像头 和 实现增强现实效果

unity打开htc vive 的前置摄像头 和 实现增强现实效果


4, 设置Material属性


unity打开htc vive 的前置摄像头 和 实现增强现实效果

unity打开htc vive 的前置摄像头 和 实现增强现实效果

E  quad.


unity打开htc vive 的前置摄像头 和 实现增强现实效果

这个东西有正反面之分,如果是反面就看不到了。


unity打开htc vive 的前置摄像头 和 实现增强现实效果


unity打开htc vive 的前置摄像头 和 实现增强现实效果

相关文章:

  • 2022-01-29
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2021-08-28
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2021-08-11
  • 2022-01-15
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案