Building virtual reality experiences on the web with React VR
Over the past year, virtual reality has made major strides toward becoming the next computing platform. With Oculus Rift, consumer-grade hardware has reached the point where people can immerse themselves in virtual worlds from their own home. Alongside that, 360 content has blossomed with the introduction of numerous consumer-level cameras and Facebook"s support of 360 photos and videos. However, for developers who have pioneered the way we experience the web, there"s no direct path to building 360 content without knowledge of game engines and 3D graphics. Those who do take on the challenges of creating interactive 360 applications may find themselves with limited audiences, since VR headsets aren"t yet widely distributed. We want to change that.
Today, we"re releasing React VR, a new library that lets developers everywhere build compelling experiences for VR. Expanding on the declarative programming style of React and React Native, React VR lets anyone with an understanding of JavaScript rapidly build and deploy VR experiences using standard web tools. Those experiences can then be distributed across the web — React VR leverages APIs like WebGL and WebVR to connect immersive headsets with a scene in a web page. And to maximize your potential audience, sites built in React VR are also accessible on mobile phones and PCs, using accelerometers or the cursor for navigation.
With React VR, you can use React components to compose scenes in 3D, combining 360 panoramas with 2D UI, text, and images. You can immerse the user with audio and video capabilities, plus take full advantage of the space around you with 3D models. If you know React, you now know how to build 360 and VR content! The entire codebase is available on GitHub. Get started with your first project by diving into our documentation.
Learn once, write anywhereWhen we set out to build a framework for VR content on the web, we quickly agreed that React was a great starting point. React"s style of representing elements abstractly, independent of their actual implementation, is ideal for any hierarchical layout, and it"s already proven its flexibility with the React Native platform. Additionally, it means that anyone familiar with React can easily get started without needing to learn new concepts. If you"re comfortable laying out an application with React and understand how React manages data flow, you should have no problem developing in 3D. React VR continues to drive the mantra of the React ecosystem: Learn once, write anywhere.
Building upon React also means that the libraries and tools built by the broader React community are available for your use in React VR. Your favorite data management, routing, and navigation libraries will work out of the box. You can leverage existing testing frameworks and development tools as well — there"s no need to change your existing development workflow.
Under the hoodWhen building a framework for VR on the web, one challenge we had to address is that a person in a headset needs to be able to look around the world at 60 frames per second (fps), or 90 fps on Rift. In a single-threaded environment like JavaScript, that means we needed to ensure that any React reconciliation or scene updates would happen within the span of a single frame.
As it turns out, React Native already addresses similar problems with its architecture. We followed RN"s pattern by running React and rendering in separate contexts, with an asynchronous bridge for communication between them. In the web browser, this separation is performed with a web worker — your entire React application runs in the worker, while the rendering code that turns scene update messages into actual pixels lives in the main window. This lets the renderer create a tight loop between receiving headset orientation updates and re-rendering the scene, increasing viewer immersion while decreasing the likelihood of motion sickness.
In fact, more than just borrowing concepts from React Native, React VR is actually built as a true RN platform. This lets us reuse code and systems in some places, while extending other areas to make sense in both a browser and 3D space. If you"ve used React Native before, many things will be familiar to you, like the use of View and Text components, as well as the packaging server that keeps your compiled bundle updated with your latest changes.
Open sourceWe"ve seen firsthand how much React and React Native have benefited from being open source, and we believe that developing a project hand-in-hand with the community lets us better recognize and target the needs of everyone.
We hope that with React VR in your toolbox, you"ll help make 2017 the best year yet for compelling VR content. Whether you"re working on your first application or want to contribute to the framework itself, our documentation and GitHub repository are the best places to start. We look forward to seeing you in virtual reality!
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/82584.html
摘要:新聞熱點(diǎn)國內(nèi)國外,前端最新動(dòng)態(tài)發(fā)布近日,正式發(fā)布新版本中提供了一系列的特性與問題修復(fù)。而近日正式發(fā)布,其能夠幫助開發(fā)者快速構(gòu)建應(yīng)用。 前端每周清單第 10 期:Firefox53、React VR發(fā)布、JS測試技術(shù)概述、Microsoft Edge現(xiàn)代DOM樹構(gòu)建及性能之道 為InfoQ中文站特供稿件,首發(fā)地址為這里;如需轉(zhuǎn)載,請(qǐng)與InfoQ中文站聯(lián)系。從屬于筆者的 Web 前端入門...
摘要:快速入門什么是是一個(gè)開放源代碼的庫,為呈現(xiàn)的數(shù)據(jù)提供了視圖渲染。最后,項(xiàng)目根組件應(yīng)該通過來進(jìn)行注冊(cè),以便能夠進(jìn)行打包和正常運(yùn)行。基本思想是渲染一個(gè)立方體,并將觀眾置于中心,隨后移動(dòng)。表示從指定方向平均照亮所有物體的光源。 React VR 快速入門 什么是React React是一個(gè)開放源代碼的JavaScript庫,為HTML呈現(xiàn)的數(shù)據(jù)提供了視圖渲染。React視圖通常使用指定的像H...
摘要:前端每周清單半年盤點(diǎn)之與篇前端每周清單專注前端領(lǐng)域內(nèi)容,以對(duì)外文資料的搜集為主,幫助開發(fā)者了解一周前端熱點(diǎn)分為新聞熱點(diǎn)開發(fā)教程工程實(shí)踐深度閱讀開源項(xiàng)目巔峰人生等欄目。與求同存異近日,宣布將的構(gòu)建工具由遷移到,引發(fā)了很多開發(fā)者的討論。 前端每周清單半年盤點(diǎn)之 React 與 ReactNative 篇 前端每周清單專注前端領(lǐng)域內(nèi)容,以對(duì)外文資料的搜集為主,幫助開發(fā)者了解一周前端熱點(diǎn);分為...
摘要:它不僅從前端移動(dòng)到后端,我們也開始看到它用于機(jī)器學(xué)習(xí)和增強(qiáng)現(xiàn)實(shí),簡稱。由于其高使用率,年的現(xiàn)狀調(diào)查將其稱為采用的安全技術(shù)。機(jī)器學(xué)習(xí)框架在年的開發(fā)者峰會(huì)上,宣布了他們的機(jī)器學(xué)習(xí)框架的實(shí)現(xiàn),稱為。更高級(jí)別的用于在之上構(gòu)建機(jī)器學(xué)習(xí)模型。 2019,開發(fā)者應(yīng)該學(xué)習(xí)的16個(gè)JavaScript框架 showImg(https://segmentfault.com/img/remote/14600...
摘要:新聞熱點(diǎn)國內(nèi)國外,前端最新動(dòng)態(tài)就開源許可證風(fēng)波進(jìn)行回復(fù)數(shù)周前,基金會(huì)決定禁止旗下項(xiàng)目使用,因?yàn)槠湓跇?biāo)準(zhǔn)的許可證之外添加了專利聲明此舉引發(fā)了社區(qū)的廣泛討論,希望能夠更新其開源許可證。 showImg(https://segmentfault.com/img/remote/1460000010777089); 前端每周清單第 27 期:React Patent License 回復(fù),Sho...
閱讀 1768·2023-04-26 01:44
閱讀 1211·2021-11-12 10:34
閱讀 1579·2021-09-09 09:33
閱讀 1729·2019-08-30 15:44
閱讀 2893·2019-08-30 13:49
閱讀 2191·2019-08-29 15:26
閱讀 944·2019-08-26 13:30
閱讀 1409·2019-08-23 18:15