@@ -508,6 +508,41 @@ Open up your browser to the URL above.
508508 }
509509 }
510510
511+ std::cout << " \n " ;
512+ std::cout << " Now we'll test the WebXR functionality.\n " ;
513+ std::cout << " In a new browser window, open the URL:\n "
514+ << meshcat->web_url () << " ?webxr=vr&controller=on\n " ;
515+ std::cout << " If you don't have VR hardware installed on your machine, "
516+ " you'll have to install the WebXR API emulator appropriate to "
517+ " your browser. E.g., for Google Chrome "
518+ " see:\n https://chrome.google.com/webstore/detail/"
519+ " webxr-api-emulator/mjddjgeghkdijejnciaefnkjmkafnnje\n " ;
520+ std::cout << " \n If the emulator is installed properly, you should see a "
521+ " button at the bottom that says \" Enter VR\" .\n " ;
522+ std::cout << " Open the window showing the WebXR emulator and select a VR "
523+ " device with controllers (e.g., Oculus Quest). Click the "
524+ " \" Enter VR\" button. You should see the following:\n "
525+ << " - The rendering screen is now split into two images.\n "
526+ << " - The meshcat controls are gone (there is a message in the "
527+ " console informing you of this).\n "
528+ << " - You should be able to manipulate the view in the WebXR "
529+ " emulator to affect what you see."
530+ << " When you're done, close the browser window.\n\n " ;
531+
532+ MaybePauseForUser ();
533+
534+ std::cout << " \n Now we'll try it again with *augmented* reality.\n "
535+ << " In yet another browser window, open:\n "
536+ << meshcat->web_url () << " ?webxr=ar&controller=on\n "
537+ << " This should be the same as before but with two differences:\n "
538+ << " - The button reads \" Enter XR\"\n "
539+ << " - When you click the button, the background becomes white. "
540+ " If you have an actual AR device, you should see the camera's "
541+ " image as the background.\n "
542+ << " When you're done, close the browser window.\n\n " ;
543+
544+ MaybePauseForUser ();
545+
511546 std::cout << " Exiting..." << std::endl;
512547 return 0 ;
513548}
0 commit comments