<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unity3D Mirror Mode in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021542#M38439</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have just start developing my first RealSense application using Unity3D, however, we are facing an issue when trying to disable mirror mode for an AR application.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;In the SDK Manual, there is&amp;nbsp;PXCMCapture.Device.MirrorMode and&amp;nbsp;PXCMCapture.Device.MirrorMode.MIRROR_MODE_DISABLED&lt;/P&gt;

&lt;P&gt;If I try to call capture manager and set the devices Mirror Mode:&lt;/P&gt;

&lt;P&gt;cManager.device.SetMirrorMode ( PXCMCapture.Device.MirrorMode.MIRROR_MODE_DISABLED);&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;By adding above statement in SenseToolkitManager.cs, I get an an error with a null reference exception for Capture Manager object...&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I wonder where and how should the Mirror property be set?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2015 08:12:10 GMT</pubDate>
    <dc:creator>Mohammed_A_</dc:creator>
    <dc:date>2015-07-22T08:12:10Z</dc:date>
    <item>
      <title>Unity3D Mirror Mode</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021542#M38439</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have just start developing my first RealSense application using Unity3D, however, we are facing an issue when trying to disable mirror mode for an AR application.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;In the SDK Manual, there is&amp;nbsp;PXCMCapture.Device.MirrorMode and&amp;nbsp;PXCMCapture.Device.MirrorMode.MIRROR_MODE_DISABLED&lt;/P&gt;

&lt;P&gt;If I try to call capture manager and set the devices Mirror Mode:&lt;/P&gt;

&lt;P&gt;cManager.device.SetMirrorMode ( PXCMCapture.Device.MirrorMode.MIRROR_MODE_DISABLED);&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;By adding above statement in SenseToolkitManager.cs, I get an an error with a null reference exception for Capture Manager object...&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I wonder where and how should the Mirror property be set?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 08:12:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021542#M38439</guid>
      <dc:creator>Mohammed_A_</dc:creator>
      <dc:date>2015-07-22T08:12:10Z</dc:date>
    </item>
    <item>
      <title>I don't personally know about</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021543#M38440</link>
      <description>&lt;P&gt;I don't personally know about how the Mirror Mode works - maybe someone on this forum can help with that. &amp;nbsp;There are alternatives to creating a mirror in Unity though if the Mirror Mode does not work out.&lt;/P&gt;

&lt;P&gt;If you want to create a mirror that shows the user's RL body then you could create a large board by stretching and scaling a Cube object and apply something called a WebCamTexture to the surface of it so that the camera's video feed streams onto the board in place of the texture that you have placed on the board.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.unity3d.com/ScriptReference/WebCamTexture.html" target="_blank"&gt;http://docs.unity3d.com/ScriptReference/WebCamTexture.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to put a view from a Unity game camera onto a mirror surface then you can use a RenderTexture.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.unity3d.com/Manual/class-RenderTexture.html" target="_blank"&gt;http://docs.unity3d.com/Manual/class-RenderTexture.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:46:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021543#M38440</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2015-07-22T13:46:54Z</dc:date>
    </item>
    <item>
      <title>Thanks for the reply.</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021544#M38441</link>
      <description>Thanks for the reply.

actually, I am trying to disable mirror mode in Unity. We would like to have the standard camera feed as the displayed output.

RenderTexture is a good option, the only problem would be having tp flip back text and all ui elements so they would appear correctly (since ui elements are rendered correctly in the mirror mode).

Thanks</description>
      <pubDate>Thu, 23 Jul 2015 02:06:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021544#M38441</guid>
      <dc:creator>Mohammed_A_</dc:creator>
      <dc:date>2015-07-23T02:06:46Z</dc:date>
    </item>
    <item>
      <title>It is possible to flip the</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021545#M38442</link>
      <description>&lt;P&gt;It is possible to flip the camera view horizontally and / or vertically using a script placed inside it. &amp;nbsp;I found a JavaScript one on the net and tried it with my own mirror to confirm that it works. &amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here's one that flips both horizontally and vertically.&lt;/P&gt;

&lt;PRE class="brush:;"&gt;// EXAMPLE WITH CAMERA UPSIDEDOWN
 function OnPreCull () {
     GetComponent.&amp;lt;Camera&amp;gt;().ResetWorldToCameraMatrix ();
     GetComponent.&amp;lt;Camera&amp;gt;().ResetProjectionMatrix ();
     GetComponent.&amp;lt;Camera&amp;gt;().projectionMatrix = GetComponent.&amp;lt;Camera&amp;gt;().projectionMatrix * Matrix4x4.Scale(Vector3 (-1, -1, 1));
 }
  
 function OnPreRender () {
     GL.SetRevertBackfacing (true);
 }
  
 function OnPostRender () {
     GL.SetRevertBackfacing (false);
 }
  
 @script RequireComponent (Camera)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;And here is the one that only flips horizontally.&lt;/P&gt;

&lt;PRE class="brush:;"&gt;// EXAMPLE WITH CAMERA UPSIDEDOWN
 function OnPreCull () {
     GetComponent.&amp;lt;Camera&amp;gt;().ResetWorldToCameraMatrix ();
     GetComponent.&amp;lt;Camera&amp;gt;().ResetProjectionMatrix ();
     GetComponent.&amp;lt;Camera&amp;gt;().projectionMatrix = GetComponent.&amp;lt;Camera&amp;gt;().projectionMatrix * Matrix4x4.Scale(Vector3 (1, -1, 1));
 }
  
 function OnPreRender () {
     GL.SetRevertBackfacing (true);
 }
  
 function OnPostRender () {
     GL.SetRevertBackfacing (false);
 }
  
 @script RequireComponent (Camera)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Basically in the "Scale(Vector3 (1, -1, 1))" section, you can flip a particular axis by adding a minus sign in front of the '1' numbers in the bracket - the first being X, the second being Y and the third being Z.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 06:25:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021545#M38442</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2015-07-23T06:25:46Z</dc:date>
    </item>
    <item>
      <title>Regarding disabling Mirror</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021546#M38443</link>
      <description>&lt;P&gt;Regarding disabling Mirror Mode: if your Mirror Mode script is inside an object, then disabling that object should also disable the visibility of any scripted effects generated by it.&lt;/P&gt;

&lt;P&gt;The simple JavaScript script below can disable an object by un-ticking the tick-box at the very top of the Inspector panel that controls whether an object is active or not.&lt;/P&gt;

&lt;PRE class="brush:;"&gt;function Start () {
gameObject.active = false;

}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Place it inside the object containing your Mirror Mode script. &amp;nbsp;If you want to make a separate script that makes the Mirror Mode object visible again, just change "false" in the above code to "true" so that it reads:&lt;/P&gt;

&lt;PRE class="brush:;"&gt;function Start () {
gameObject.active = true;

}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Edit: if you want an easy way of triggering an activation or deactivation script, you can link your script to a SendMessageAction script that is supplied with the RealSense Unity Toolkit. &amp;nbsp;Then you could use a hand or face gesture to turn the Mirror Mode on and off.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/using-the-unity-toolkit-sendmessage-action-with-intel-realsense-technology" target="_blank"&gt;https://software.intel.com/en-us/articles/using-the-unity-toolkit-sendmessage-action-with-intel-realsense-technology&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 11:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity3D-Mirror-Mode/m-p/1021546#M38443</guid>
      <dc:creator>MartyG</dc:creator>
      <dc:date>2015-07-23T11:22:00Z</dc:date>
    </item>
  </channel>
</rss>

