SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Tony Parisi
is VP of Web and Open Technologies
tony@wevr.com
+1  (415) 902 8002
@auradeluxe
react-vr
an early experiment with React and
WebGL for VR development
the experiment
spherical 360 video player for the web
the React (1)
var App = React.createClass({
getInitialState: function() {
return { url: "../360videos/MythBusters+-
+Sharks+Everywhere!+(360+Video)-3WIS6N_9gjA.mp4" };
},
render: function() {
return (
<VRPlayer url={this.state.url}></VRPlayer>
);
}
});
the React (2)
var VRPlayer = React.createClass({
render: function() {
return (
<div className="vr_player"></div>
);
},
the React (3)
componentDidMount : function() {
this.container = React.findDOMNode(this);
// Initialize THREE
this.initThreeJS();
// Create the scene content
this.initScene();
// Create the camera controller
this.initControls();
var that = this;
// Run the run loop
window.requestAnimationFrame(function(time) {
that.run(time);
});
},
the VR
•render WebGL using Three.js
•use requestAnimationFrame()
for update loop
•use THREE.OrbitControls for
panning
•actually no VR yet!— that’s
next
// Create a new Three.js scene
var scene = new THREE.Scene();
// Add a camera so we can view the scene
var camera = new THREE.PerspectiveCamera( 90,
window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = .001;
scene.add(camera);
// Create a video texture for playing the movie
var video = document.createElement('video');
video.autoplay = true;
video.src = this.props.url;
var texture = new THREE.VideoTexture( video );
texture.minFilter = THREE.LinearFilter;
texture.magFilter = THREE.LinearFilter;
texture.format = THREE.RGBFormat;
var material = new THREE.MeshBasicMaterial({
map: texture,
side:THREE.DoubleSide });
// Create the sky sphere geometry
var geometry = new THREE.SphereGeometry(10, 32, 32);
// We're looking at the inside
geometry.applyMatrix(
new THREE.Matrix4().makeScale( -1, 1, 1 ) );
next steps
1. add WebVR and Cardboard support
2. investigate integrating with GLAM (GL and Markup)
http://www.glamjs.org/
•how deep can React integration go? (who owns the
“scene graph”?)
•compare to performance of DOM/Web Components-
based approaches
Thank
You.
Tony Parisi
is VP of Web and Open Technologies
tony@wevr.com
+1  (415) 902 8002
@auradeluxe
this experiment can be found on Github at
https://github.com/tparisi/react-vr

Weitere ähnliche Inhalte

Was ist angesagt?

WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
Tony Parisi
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
Rapid development with angular
Rapid development with angularRapid development with angular
Rapid development with angular
Hongbiao Chen
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
Christopher Schmitt
 

Was ist angesagt? (20)

WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was Won
 
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
Goodbye, Flatland! An introduction to React VR  and what it means for web dev...Goodbye, Flatland! An introduction to React VR  and what it means for web dev...
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
 
How to create 360 Image/panorama & share with WebVR?
How to create  360 Image/panorama & share with WebVR?How to create  360 Image/panorama & share with WebVR?
How to create 360 Image/panorama & share with WebVR?
 
WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...
WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...
WebXR: A New Dimension For The Web Writing Virtual and Augmented Reality Apps...
 
WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
 
Y U NO CRAFTSMAN
Y U NO CRAFTSMANY U NO CRAFTSMAN
Y U NO CRAFTSMAN
 
More Ways to Make Your Users Sick – A talk about WebVR and UX Design
More Ways to Make Your Users Sick – A talk about WebVR and UX DesignMore Ways to Make Your Users Sick – A talk about WebVR and UX Design
More Ways to Make Your Users Sick – A talk about WebVR and UX Design
 
20180524 Android Taipei : RxJava Threading
20180524 Android Taipei : RxJava Threading20180524 Android Taipei : RxJava Threading
20180524 Android Taipei : RxJava Threading
 
Going Node At Netflix
Going Node At NetflixGoing Node At Netflix
Going Node At Netflix
 
Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.Why reactive programing matter, and how PicCollage adaptive it.
Why reactive programing matter, and how PicCollage adaptive it.
 
Node básico para front end developers
Node básico para front end developersNode básico para front end developers
Node básico para front end developers
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing Tool
 
全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
 
AngularJS - Overcoming performance issues. Limits.
AngularJS - Overcoming performance issues. Limits.AngularJS - Overcoming performance issues. Limits.
AngularJS - Overcoming performance issues. Limits.
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
 
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
 
Rapid development with angular
Rapid development with angularRapid development with angular
Rapid development with angular
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
 
Real-time collaborative drawing
Real-time collaborative drawingReal-time collaborative drawing
Real-time collaborative drawing
 
(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer
 

Andere mochten auch

Rpl 7 ppl dan metrik proyek (2)
Rpl 7 ppl dan metrik proyek (2)Rpl 7 ppl dan metrik proyek (2)
Rpl 7 ppl dan metrik proyek (2)
Komang Yogi
 
nghiên cứu marketing - nhà trọ sinh viên
nghiên cứu marketing - nhà trọ sinh viênnghiên cứu marketing - nhà trọ sinh viên
nghiên cứu marketing - nhà trọ sinh viên
Eric Thanh Hải
 
Konsep Tanzil: Arkoun dan Zarqani
Konsep Tanzil: Arkoun dan ZarqaniKonsep Tanzil: Arkoun dan Zarqani
Konsep Tanzil: Arkoun dan Zarqani
Anwar Ma'rufi
 
PABUG 2016 Barros Landry ITIL with Snow FINAL
PABUG 2016 Barros Landry ITIL with Snow FINALPABUG 2016 Barros Landry ITIL with Snow FINAL
PABUG 2016 Barros Landry ITIL with Snow FINAL
Stephen Landry
 
Progetto involucro. Prof.Iovino
Progetto involucro.  Prof.IovinoProgetto involucro.  Prof.Iovino
Progetto involucro. Prof.Iovino
Antonella0_91
 
Aile nin önemi 2003
Aile nin önemi 2003Aile nin önemi 2003
Aile nin önemi 2003
Ozan Yılmaz
 

Andere mochten auch (20)

Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17
 
WebVR Ecosystem and API Update
WebVR Ecosystem and API UpdateWebVR Ecosystem and API Update
WebVR Ecosystem and API Update
 
The Coming Distribution War
The Coming Distribution WarThe Coming Distribution War
The Coming Distribution War
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 
Vrml, or There and Back Again
Vrml, or There and Back AgainVrml, or There and Back Again
Vrml, or There and Back Again
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually Anyone
 
The Immersive Web
The Immersive WebThe Immersive Web
The Immersive Web
 
A-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersA-Frame: VR for Web Developers
A-Frame: VR for Web Developers
 
Rpl 7 ppl dan metrik proyek (2)
Rpl 7 ppl dan metrik proyek (2)Rpl 7 ppl dan metrik proyek (2)
Rpl 7 ppl dan metrik proyek (2)
 
nghiên cứu marketing - nhà trọ sinh viên
nghiên cứu marketing - nhà trọ sinh viênnghiên cứu marketing - nhà trọ sinh viên
nghiên cứu marketing - nhà trọ sinh viên
 
1 archivos jar
1 archivos jar1 archivos jar
1 archivos jar
 
Konsep Tanzil: Arkoun dan Zarqani
Konsep Tanzil: Arkoun dan ZarqaniKonsep Tanzil: Arkoun dan Zarqani
Konsep Tanzil: Arkoun dan Zarqani
 
PABUG 2016 Barros Landry ITIL with Snow FINAL
PABUG 2016 Barros Landry ITIL with Snow FINALPABUG 2016 Barros Landry ITIL with Snow FINAL
PABUG 2016 Barros Landry ITIL with Snow FINAL
 
Progetto involucro. Prof.Iovino
Progetto involucro.  Prof.IovinoProgetto involucro.  Prof.Iovino
Progetto involucro. Prof.Iovino
 
Visions i cants s. buñuel i a. moreno
Visions i cants s. buñuel i a. morenoVisions i cants s. buñuel i a. moreno
Visions i cants s. buñuel i a. moreno
 
Propuesta capacitaciones design thinking lean
Propuesta capacitaciones design thinking leanPropuesta capacitaciones design thinking lean
Propuesta capacitaciones design thinking lean
 
Albrecht Durer
Albrecht DurerAlbrecht Durer
Albrecht Durer
 
Resume
ResumeResume
Resume
 
Aile nin önemi 2003
Aile nin önemi 2003Aile nin önemi 2003
Aile nin önemi 2003
 
Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015Browser-Based Virtual Reality April 2015
Browser-Based Virtual Reality April 2015
 

Ähnlich wie React-VR: An Early Experiment with React and WebGL for VR Development

Viktor Turskyi - How to create a VR application with React
Viktor Turskyi - How to create a VR application with ReactViktor Turskyi - How to create a VR application with React
Viktor Turskyi - How to create a VR application with React
OdessaJS Conf
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
Yekmer Simsek
 

Ähnlich wie React-VR: An Early Experiment with React and WebGL for VR Development (20)

Viktor Turskyi - How to create a VR application with React
Viktor Turskyi - How to create a VR application with ReactViktor Turskyi - How to create a VR application with React
Viktor Turskyi - How to create a VR application with React
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recap
 
Vue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapyVue JS @ MindDoc. The progressive road to online therapy
Vue JS @ MindDoc. The progressive road to online therapy
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Docker d2 박승환
Docker d2 박승환Docker d2 박승환
Docker d2 박승환
 
Angular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of StatesAngular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of States
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
React & The Art of Managing Complexity
React &  The Art of Managing ComplexityReact &  The Art of Managing Complexity
React & The Art of Managing Complexity
 
Турський Віктор “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
Турський Віктор  “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...Турський Віктор  “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
Турський Віктор “Як (і чому) побудувати додаток VR з ReactVR?” GameDev Confe...
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
Analysing Github events with Neo4j
Analysing Github events with Neo4jAnalysing Github events with Neo4j
Analysing Github events with Neo4j
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Dive into React Performance
Dive into React PerformanceDive into React Performance
Dive into React Performance
 
React on es6+
React on es6+React on es6+
React on es6+
 
Seti 09
Seti 09Seti 09
Seti 09
 
A Little Backbone For Your App
A Little Backbone For Your AppA Little Backbone For Your App
A Little Backbone For Your App
 
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VRHow to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
 

Mehr von Tony Parisi

Mehr von Tony Parisi (16)

The New Fine Arts
The New Fine ArtsThe New Fine Arts
The New Fine Arts
 
Face the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented WorldFace the Future: Computing in an Augmented World
Face the Future: Computing in an Augmented World
 
VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015VR Without Borders RIVER WebVR April 2015
VR Without Borders RIVER WebVR April 2015
 
glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015glTF and the WebGL Art Pipeline March 2015
glTF and the WebGL Art Pipeline March 2015
 
Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014Up And Running With Web VR Fall 2014
Up And Running With Web VR Fall 2014
 
The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014The Web Eats Everything In Its Path Fall 2014
The Web Eats Everything In Its Path Fall 2014
 
WebGL, WebVR and the Metaverse
WebGL, WebVR and the MetaverseWebGL, WebVR and the Metaverse
WebGL, WebVR and the Metaverse
 
And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?And Who Shall Control the Metaverse?
And Who Shall Control the Metaverse?
 
WebGL Primetime!
WebGL Primetime!WebGL Primetime!
WebGL Primetime!
 
Virtually Anywhere
Virtually AnywhereVirtually Anywhere
Virtually Anywhere
 
The Browser As Console - HTML5 and WebGL for Game Development
The Browser As Console - HTML5 and WebGL for Game DevelopmentThe Browser As Console - HTML5 and WebGL for Game Development
The Browser As Console - HTML5 and WebGL for Game Development
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGL
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO Time
 
glTF Update with Tony Parisi WebGL Meetup August 2013
glTF Update with Tony Parisi WebGL Meetup August 2013glTF Update with Tony Parisi WebGL Meetup August 2013
glTF Update with Tony Parisi WebGL Meetup August 2013
 
Building Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGLBuilding Rich Internet Applications with HTML5 and WebGL
Building Rich Internet Applications with HTML5 and WebGL
 
Artists Only
Artists OnlyArtists Only
Artists Only
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

React-VR: An Early Experiment with React and WebGL for VR Development

  • 1. Tony Parisi is VP of Web and Open Technologies tony@wevr.com +1  (415) 902 8002 @auradeluxe react-vr an early experiment with React and WebGL for VR development
  • 2. the experiment spherical 360 video player for the web
  • 3. the React (1) var App = React.createClass({ getInitialState: function() { return { url: "../360videos/MythBusters+- +Sharks+Everywhere!+(360+Video)-3WIS6N_9gjA.mp4" }; }, render: function() { return ( <VRPlayer url={this.state.url}></VRPlayer> ); } });
  • 4. the React (2) var VRPlayer = React.createClass({ render: function() { return ( <div className="vr_player"></div> ); },
  • 5. the React (3) componentDidMount : function() { this.container = React.findDOMNode(this); // Initialize THREE this.initThreeJS(); // Create the scene content this.initScene(); // Create the camera controller this.initControls(); var that = this; // Run the run loop window.requestAnimationFrame(function(time) { that.run(time); }); },
  • 6. the VR •render WebGL using Three.js •use requestAnimationFrame() for update loop •use THREE.OrbitControls for panning •actually no VR yet!— that’s next // Create a new Three.js scene var scene = new THREE.Scene(); // Add a camera so we can view the scene var camera = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 10000 ); camera.position.z = .001; scene.add(camera); // Create a video texture for playing the movie var video = document.createElement('video'); video.autoplay = true; video.src = this.props.url; var texture = new THREE.VideoTexture( video ); texture.minFilter = THREE.LinearFilter; texture.magFilter = THREE.LinearFilter; texture.format = THREE.RGBFormat; var material = new THREE.MeshBasicMaterial({ map: texture, side:THREE.DoubleSide }); // Create the sky sphere geometry var geometry = new THREE.SphereGeometry(10, 32, 32); // We're looking at the inside geometry.applyMatrix( new THREE.Matrix4().makeScale( -1, 1, 1 ) );
  • 7. next steps 1. add WebVR and Cardboard support 2. investigate integrating with GLAM (GL and Markup) http://www.glamjs.org/ •how deep can React integration go? (who owns the “scene graph”?) •compare to performance of DOM/Web Components- based approaches
  • 8. Thank You. Tony Parisi is VP of Web and Open Technologies tony@wevr.com +1  (415) 902 8002 @auradeluxe this experiment can be found on Github at https://github.com/tparisi/react-vr