WebVR Polyfill ist eine JavaScript-Implementierung der WebXR-Spezifikation. Dieses Projekt stellt sicher, dass Ihre WebXR-Inhalte auf jeder Plattform funktionieren, unabhängig davon, ob der Browser/das Gerät native WebXR-Unterstützung hat oder nicht, oder wenn es Inkonsistenzen in der Implementierung gibt.
$ npm install --save webvr-polyfill
In Ihrem HalloVR Verzeichnis öffnen Sie nun die client.js und fügen folgenden Code ein:
import WebVRPolyfill from 'webvr-polyfill';
const polyfill = new WebVRPolyfill();
Ihre client.js sollte jetzt so aussehen:
// This file contains the boilerplate to execute your React app.
// If you want to modify your application's content, start in "index.js"
import {ReactInstance} from 'react-360-web';
import WebVRPolyfill from 'webvr-polyfill';
const polyfill = new WebVRPolyfill();
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
...options,
});
// Render your app content to the default cylinder surface
r360.renderToSurface(
r360.createRoot('HelloWorld2', { /* initial props */ }),
r360.getDefaultSurface()
);
// Load the initial environment
r360.compositor.setBackground(r360.getAssetURL('360_world.jpg'));
}
window.React360 = {init};
Screenshot
View in VR
https://facebook.github.io/react-360/
Ich werde in den nächsten Wochen Demo Anwendungen gestalten, und werde diese hier im r23:Blog Ihnen zeigen.
Wir unterstützen Sie bei der Umsetzung Ihres Augmented Reality (AR) oder Virtual Reality (VR) Projektes! Ob Produktfotografie, 3D-Scan-Service, 3D-Visualisierung oder fertige 3D-Modelle für AR/VR - wir beraten Sie persönlich und unverbindlich.
Wenn Sie ein individuelles Angebot auf Basis Ihrer aktuellen Vorlagen (Fotos, Zeichnungen, Skizzen) wünschen, nutzen Sie einfach unser Anfrageformular.
© 2023 R23 | AGB | Datenschutz | Cookie-Einstellungen | Kundenbewertungen | Impressum |
Kommentar verfassen