SlideShare uma empresa Scribd logo
1 de 12
Baixar para ler offline
[Type the document title] [Year]
Build UI of the Future with React 360
Build UI of the Future with React 360
© RapidValue Solutions 2
Detailed Steps to Build the UI of the Future with React 360
Project – Poke World
Now that we have understood the basics, we can go on to creating the actual project as mentioned in
the beginning.
Build UI of the Future with React 360
© RapidValue Solutions 3
Action Plan
The environment that we plan to create is built on top of the 360 Photo backgrounds, which was
shipped along with the React 360 template. Other than that, we require 3D models of the following
items.
 Pokemon
 Pokeball
 Stadium
These 3D models can be imported from any websites which help us download free models. In our
example, we have used the free low poly models that were provided by poly.google.com. We can
also, use the 3D models created in 3D software's like Maya as well.
There are two types of file formats supported by React 360 platform (GLTF2 and OBJ model). Fpr
this project, we will be using the OBJ model.
Other than the 3D models, we have a welcome screen which shows the title image of the Pokemon.
(You can refer to this demo). The welcome screen has a background image attached to a cylindrical
surface which is among one of the pre-built components provided by React 360. We also play a
background audio of Pokemon theme song and sounds of individual Pokemon.
All of these external assets are stored in a folder called static_assets, which is present at the root
level of our folder, created by default. Any asset in this folder can be referred to in our code files or
components imported inside index.js, using the below statement.
asset('item-name.ext')
Creating Components
Let’s discuss how the various components are built. We will be using a total of five components
together as per the requirement. First of all, we will create a folder called Components in the root
directory. All the components will be created inside this folder, which will contribute towards a better
structure of our application.
Build UI of the Future with React 360
© RapidValue Solutions 4
Screen Component
This is the most basic component that is used in our project. It only displays a static text in a
transparent screen in the background of our poke-world. You can rotate the scene to view this in the
background here.
You can find the code in the repo URL.
We have used a number of pre-built components provided by React 360 like Stylesheet, Views, Text.
These are the components which are built to support the 3D environment:
 Stylesheet is used to create styles and inject it into our components. It follows jss like syntax.
 Views are used to create either group content, or provide visual boxes on the screen. You can
use them to provide layout without actually rendering anything, or they can be used to create
the kinds of border and background effects.
 Text is for adding characters to the screen. If you’re creating a 2D UI, this is a critical element
for surfacing information to the user, labeling UI elements, and more. Now that we have
created a component for screen, it needs to bind to a surface.
 Surfaces allow you to add 2D interfaces in 3D space, letting you work in pixels instead of
physical dimensions. Currently, there are two different shapes of Surfaces: Cylinder and Flat.
We will be using a flat surface for the screen component. Since a flat surface can be positioned
anywhere within the environment, unlike a cylinder component which will always appear at the front of
the user, no matter where you turn.
Build UI of the Future with React 360
© RapidValue Solutions 5
To attach a React component to a Surface, it must be registered with the AppRegistry.
In index.js file you can see a block of code like below, where we are registering the component with
the AppRegistry. This step needs to be repeated for all the components that we are creating in our
project.
import React from 'react';
import { AppRegistry } from 'react-360';
import Screen from './components/Screen';
AppRegistry.registerComponent('Screen', () =>
Screen);
index.js
For creating a surface in our client.js file, use the below code in the init function.
const screenSurface = new Surface(800, 400,
Surface.SurfaceShape.Flat);
screenSurface.setAngle(-3.3 /* yaw angle */, 0 /* pitch
angle */);
// Render your app content to the default cylinder
surfacer360.renderToSurface(r360.createRoot('Screen'),
screenSurface);
client.js inside init function
The name used here in createRoot should be the same as the one we register the component with in
AppRegistry. Now, that we have completed the steps for a basic component, save and reload the
page and you can see the screen component with the message at the rendered position.
Store (Utility)
Since our previous screen component was a static component which rendered a surface, we didn’t
require any communication with other components. But all of our other components need to
communicate with each other. The initial props to each component can be passed from
our client.js file. Any other communication needs to be handled through a global store like redux,
same as the one that we use in react.
Since this is for a demo purpose, we will be creating a store on our own.
You can find the code in the repo URL.
connect function is a higher order component similar to the one in React.js which accepts another
component as argument and returns the provided component with binding required data. We will be
Build UI of the Future with React 360
© RapidValue Solutions 6
using this method from store to connect our components to the global store, which will help them to
communicate with each other.
Loading Screen Component
The purpose of our loading screen component is to show a loading message and the title of our
theme. The title is an image attached to a cylindrical surface that we mentioned in the screen
component.
You can find the code in the repo URL.
The main difference we can see in this component is the use of Animation, Image and connecting to
a store.
Animated library is designed to make animations fluid, powerful and easy to build and
maintain. Animated library makes it possible to toggle the size, position, and appearance of elements
in your scene in a declarative style that fits into React. It was originally designed for React Native and
you can read further about its supported methods from the React Native documentation.
Image A React component for displaying 2D images on a surface. Image sources can be externally-
hosted resources, or referenced from your static_assets directory and hosted alongside your app.
Here, instead of exporting the default component we are using the component returned from our
connect method in store, which we discussed in the above section. And we are referring to the
additional props provided by the connect method ( PokeDesk.ShowPokeballs) to toggle the
component’s presence in our environment.
Build UI of the Future with React 360
© RapidValue Solutions 7
World Component
The purpose of the world component is to load the 3D model for the stadium which we are
considering as one of the 3D prop in our scene. The world component will have an environmental
audio which is the theme music of Pokemon being played in the background.
You can find the code below or in the repo URL.
The new items that are being introduced in this component are AudioModule and Entity.
 AudioModule - React 360 gives you a number of ways to play audio, including background
environmental audio, one-off sound effects, and spatialized audio. All audio playbacks are
controlled through the AudioModule provided by the Native Module.
 Entity allows you to render 3D objects, as described in the 3D Object documentation. At the
moment, React 360 supports Wavefront OBJ files and GLTF files. The external resource (or
resources) containing the model’s information are provided using a source attribute, which is
an object of key-value pairs mapping resource types to their locations.
The following properties are currently supported:
obj - Location of an OBJ-formatted model
mtl - Location of a MTL-formatted material (the companion of OBJ)
gltf2 - Location of a standalone GLTF2 model
Build UI of the Future with React 360
© RapidValue Solutions 8
In the style attribute using transform, we can provide the values for the x, y, z axis for positioning of
the object and we are providing the scale value as well.
Poke-ball Component
The Poke-ball component has a click event and it toggles its design on each click. It also plays a
different sound when opened and closed using the audio module’s playOneShot method.
You can find the code in the repo URL.
The new items that we got introduced to in this are the Interpolate, VrButton and the Props used.
 Interpolate is an operation applied on an animated value to transform it from the input value to
a corresponding output value.
 VrButton is a utility class that detects click-type actions across a variety of input devices. By
default, a VrButton has no appearance and will only act as a wrapper to capture events, but it
can be styled in the same way as a View.
 Props are being passed from the store as well as from the client.js file where we bind the
component to runtime.
r360.renderToLocation(
r360.createRoot('PokeBall1', {
position: {
x: -1,
y: 0,
z: -2
},
open: { angle: 125 },
close: { angle: 240 },
pokemon: 'Pikachu'
}),
r360.getDefaultLocation()
);
A snippet from client.js file
Build UI of the Future with React 360
© RapidValue Solutions 9
Here, we can see that instead of renderToSurface method that was used in the case of 2D surfaces
we created before, we are using renderToLocation method since the 3D models can only be bound
to a location with co-ordinates rather than a 2D surface. We are using
the getDefaultLocation method to fetch the default location. We can also create custom locations if
we want to, based on the demand. The props, like position, are being passed to the component
which they are being referred from within the component.
Pokemon Component
The Pokemon component is responsible for toggling the display of Pokemon which is passed as a
prop set in our global store, when we click on the corresponding poke-ball. It also plays the sounds of
individual Pokemon when it is summoned or clicked upon.
You can find the code in the repo URL.
Here, we can see the assets are dynamically loaded, based on the prop name, passed from the
component binding to runtime. This ensures the re-usability of the same Pokemon component for
loading a different Pokemon.
We are now done with creating different components and all that is left is to register them with
AppRegistry in index.js, as mentioned in the first screen component and also, binding each
component to the runtime in client.js file.
You can see the demo and completed code base in the below listed URL’s:
 Demo-URL
 Git hub-code-base-URL
Google Cardboard Support
There is no direct support provided by React 360 for Google Cardboard devices but we can provide
the support using WebVR or WebXR polyfills. As there seems to be an issue with the current version
Build UI of the Future with React 360
© RapidValue Solutions 10
of React 360 and the polyfills, we can’t use that now. Hence, we are limited to the web browser view
or VR Devices like Oculus. We hope that this issue gets resolved soon by the React 360 team.
The Final Steps
Now that we have created our application, these are the final steps that are remaining:
 Build
We can generate a production build by executing the below command in terminal.
npm run bundle
After running build, we need to move the static_assets folder into the build directory as this is not
automatically taken care of, since assets can be hosted externally as well. To avoid repetition of
moving the assets folder into the build directory, we are using a plugin called ncp which is a package
provided by npm. We are using that in the script section of our package.json file like shown below:
{
"scripts": {
"start": "node node_modules/react-
360/scripts/packager.js",
"bundle": "node node_modules/react-360/scripts/bundle.js",
"move-assets": "ncp static_assets build/static_assets",
"predeploy": "npm run bundle && npm run move-assets",
"deploy": "gh-pages -d build"
}
}
 Deploy
Since in this project we are using github pages for hosting our website, we need to configure the
github pages plugin in our project (refer online) and execute the below statement in the terminal.
npm run deploy
Conclusion
React 360 can be a good entry level tool for developers who want to build for the users of VR. But in
comparison with Aframe, which is a framework for building VR worlds using declarative HTML-like
Build UI of the Future with React 360
© RapidValue Solutions 11
components, one might feel React 360 is not at par with Aframe. This is addressed by the React 360
team itself.
We believe that React 360 serves a different use case optimized around applications that rely on user
interfaces, or are event-driven in nature.
By,
Arun Anto, Senior Software Engineer, RapidValue
Build UI of the Future with React 360
© RapidValue Solutions 12
About RapidValue
RapidValue is a global leader in digital product engineering solutions including mobility, omni-channel, IoT, AI, RPA and
cloud to enterprises worldwide. RapidValue offers its digital services to the world’s top brands, Fortune 1000 companies and
innovative emerging start-ups. With offices in the United States, the United Kingdom, Germany and India and
operations spread across the Middle-East, Europe and Canada, RapidValue delivers enterprise services and
solutions across various industry verticals.
www.rapidvaluesolutions.com www.rapidvaluesolutions.com/blog
+1 877.643.1850 contactus@rapidvaluesolutions.com
Disclaimer:
This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or
Reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation,
quoting, or reproducing of this report is strictly prohibited and may be unlawful.

Mais conteúdo relacionado

Mais procurados

Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspectiveDeSmart Agile Software House
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend DevelopersSergio Nakamura
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1Hussain Behestee
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Paris Android User Group
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014inovex GmbH
 
Mobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sMobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sAdam Wilson
 
GOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in ChennaiGOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in Chennailakshmipriyaaka
 
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemFull Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemDigamber Singh
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2Demey Emmanuel
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2Demey Emmanuel
 
GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3Faiz Bashir
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized projectFabio Collini
 
AngularJS - dependency injection
AngularJS - dependency injectionAngularJS - dependency injection
AngularJS - dependency injectionAlexe Bogdan
 
JavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopJavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopPeter Lehto
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesMarios Fakiolas
 

Mais procurados (20)

Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspective
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
Building maintainable app
Building maintainable appBuilding maintainable app
Building maintainable app
 
Angular 9
Angular 9 Angular 9
Angular 9
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014
 
Mobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sMobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’s
 
GOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in ChennaiGOOGLE APP ENGINE Training in Chennai
GOOGLE APP ENGINE Training in Chennai
 
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemFull Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication System
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
GWT Training - Session 1/3
GWT Training - Session 1/3GWT Training - Session 1/3
GWT Training - Session 1/3
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized project
 
AngularJS - dependency injection
AngularJS - dependency injectionAngularJS - dependency injection
AngularJS - dependency injection
 
JavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopJavaEE with Vaadin - Workshop
JavaEE with Vaadin - Workshop
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
Modern android development
Modern android developmentModern android development
Modern android development
 
Unit2
Unit2Unit2
Unit2
 

Semelhante a Build UI of the Future with React 360

React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperFabrit Global
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiThinkOpen
 
project_proposal_osrf
project_proposal_osrfproject_proposal_osrf
project_proposal_osrfom1234567890
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwikHetaxi patel
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
What Is BuildContext In Flutter And It's Importance
What Is BuildContext In Flutter And It's ImportanceWhat Is BuildContext In Flutter And It's Importance
What Is BuildContext In Flutter And It's ImportanceAndolasoft Inc
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumAxway Appcelerator
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAJeff Haynie
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxGevitaChinnaiah
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basicrafaqathussainc077
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react jsBOSC Tech Labs
 

Semelhante a Build UI of the Future with React 360 (20)

React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele Gallotti
 
project_proposal_osrf
project_proposal_osrfproject_proposal_osrf
project_proposal_osrf
 
Simple React Todo List
Simple React Todo ListSimple React Todo List
Simple React Todo List
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwik
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
What Is BuildContext In Flutter And It's Importance
What Is BuildContext In Flutter And It's ImportanceWhat Is BuildContext In Flutter And It's Importance
What Is BuildContext In Flutter And It's Importance
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
Diving deep in compose.pdf
Diving deep in compose.pdfDiving deep in compose.pdf
Diving deep in compose.pdf
 
iPhone/iPad Development with Titanium
iPhone/iPad Development with TitaniumiPhone/iPad Development with Titanium
iPhone/iPad Development with Titanium
 
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CAAppcelerator iPhone/iPad Dev Con 2010 San Diego, CA
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react js
 
ReactJS.pptx
ReactJS.pptxReactJS.pptx
ReactJS.pptx
 

Mais de RapidValue

How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaHow to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaRapidValue
 
Play with Jenkins Pipeline
Play with Jenkins PipelinePlay with Jenkins Pipeline
Play with Jenkins PipelineRapidValue
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using AxeRapidValue
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinRapidValue
 
Automation in Digital Cloud Labs
Automation in Digital Cloud LabsAutomation in Digital Cloud Labs
Automation in Digital Cloud LabsRapidValue
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture -  Top Trends & Key Business BenefitsMicroservices Architecture -  Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business BenefitsRapidValue
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIUploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIRapidValue
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with KotlinRapidValue
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORSRapidValue
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelRapidValue
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDRapidValue
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsRapidValue
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterRapidValue
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QARapidValue
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon StudioRapidValue
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindRapidValue
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueRapidValue
 

Mais de RapidValue (20)

How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaHow to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-Spa
 
Play with Jenkins Pipeline
Play with Jenkins PipelinePlay with Jenkins Pipeline
Play with Jenkins Pipeline
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using Axe
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
 
Automation in Digital Cloud Labs
Automation in Digital Cloud LabsAutomation in Digital Cloud Labs
Automation in Digital Cloud Labs
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture -  Top Trends & Key Business BenefitsMicroservices Architecture -  Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business Benefits
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIUploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADI
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with Kotlin
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORS
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack Channel
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation Flows
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QA
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Build UI of the Future with React 360

  • 1. [Type the document title] [Year] Build UI of the Future with React 360
  • 2. Build UI of the Future with React 360 © RapidValue Solutions 2 Detailed Steps to Build the UI of the Future with React 360 Project – Poke World Now that we have understood the basics, we can go on to creating the actual project as mentioned in the beginning.
  • 3. Build UI of the Future with React 360 © RapidValue Solutions 3 Action Plan The environment that we plan to create is built on top of the 360 Photo backgrounds, which was shipped along with the React 360 template. Other than that, we require 3D models of the following items.  Pokemon  Pokeball  Stadium These 3D models can be imported from any websites which help us download free models. In our example, we have used the free low poly models that were provided by poly.google.com. We can also, use the 3D models created in 3D software's like Maya as well. There are two types of file formats supported by React 360 platform (GLTF2 and OBJ model). Fpr this project, we will be using the OBJ model. Other than the 3D models, we have a welcome screen which shows the title image of the Pokemon. (You can refer to this demo). The welcome screen has a background image attached to a cylindrical surface which is among one of the pre-built components provided by React 360. We also play a background audio of Pokemon theme song and sounds of individual Pokemon. All of these external assets are stored in a folder called static_assets, which is present at the root level of our folder, created by default. Any asset in this folder can be referred to in our code files or components imported inside index.js, using the below statement. asset('item-name.ext') Creating Components Let’s discuss how the various components are built. We will be using a total of five components together as per the requirement. First of all, we will create a folder called Components in the root directory. All the components will be created inside this folder, which will contribute towards a better structure of our application.
  • 4. Build UI of the Future with React 360 © RapidValue Solutions 4 Screen Component This is the most basic component that is used in our project. It only displays a static text in a transparent screen in the background of our poke-world. You can rotate the scene to view this in the background here. You can find the code in the repo URL. We have used a number of pre-built components provided by React 360 like Stylesheet, Views, Text. These are the components which are built to support the 3D environment:  Stylesheet is used to create styles and inject it into our components. It follows jss like syntax.  Views are used to create either group content, or provide visual boxes on the screen. You can use them to provide layout without actually rendering anything, or they can be used to create the kinds of border and background effects.  Text is for adding characters to the screen. If you’re creating a 2D UI, this is a critical element for surfacing information to the user, labeling UI elements, and more. Now that we have created a component for screen, it needs to bind to a surface.  Surfaces allow you to add 2D interfaces in 3D space, letting you work in pixels instead of physical dimensions. Currently, there are two different shapes of Surfaces: Cylinder and Flat. We will be using a flat surface for the screen component. Since a flat surface can be positioned anywhere within the environment, unlike a cylinder component which will always appear at the front of the user, no matter where you turn.
  • 5. Build UI of the Future with React 360 © RapidValue Solutions 5 To attach a React component to a Surface, it must be registered with the AppRegistry. In index.js file you can see a block of code like below, where we are registering the component with the AppRegistry. This step needs to be repeated for all the components that we are creating in our project. import React from 'react'; import { AppRegistry } from 'react-360'; import Screen from './components/Screen'; AppRegistry.registerComponent('Screen', () => Screen); index.js For creating a surface in our client.js file, use the below code in the init function. const screenSurface = new Surface(800, 400, Surface.SurfaceShape.Flat); screenSurface.setAngle(-3.3 /* yaw angle */, 0 /* pitch angle */); // Render your app content to the default cylinder surfacer360.renderToSurface(r360.createRoot('Screen'), screenSurface); client.js inside init function The name used here in createRoot should be the same as the one we register the component with in AppRegistry. Now, that we have completed the steps for a basic component, save and reload the page and you can see the screen component with the message at the rendered position. Store (Utility) Since our previous screen component was a static component which rendered a surface, we didn’t require any communication with other components. But all of our other components need to communicate with each other. The initial props to each component can be passed from our client.js file. Any other communication needs to be handled through a global store like redux, same as the one that we use in react. Since this is for a demo purpose, we will be creating a store on our own. You can find the code in the repo URL. connect function is a higher order component similar to the one in React.js which accepts another component as argument and returns the provided component with binding required data. We will be
  • 6. Build UI of the Future with React 360 © RapidValue Solutions 6 using this method from store to connect our components to the global store, which will help them to communicate with each other. Loading Screen Component The purpose of our loading screen component is to show a loading message and the title of our theme. The title is an image attached to a cylindrical surface that we mentioned in the screen component. You can find the code in the repo URL. The main difference we can see in this component is the use of Animation, Image and connecting to a store. Animated library is designed to make animations fluid, powerful and easy to build and maintain. Animated library makes it possible to toggle the size, position, and appearance of elements in your scene in a declarative style that fits into React. It was originally designed for React Native and you can read further about its supported methods from the React Native documentation. Image A React component for displaying 2D images on a surface. Image sources can be externally- hosted resources, or referenced from your static_assets directory and hosted alongside your app. Here, instead of exporting the default component we are using the component returned from our connect method in store, which we discussed in the above section. And we are referring to the additional props provided by the connect method ( PokeDesk.ShowPokeballs) to toggle the component’s presence in our environment.
  • 7. Build UI of the Future with React 360 © RapidValue Solutions 7 World Component The purpose of the world component is to load the 3D model for the stadium which we are considering as one of the 3D prop in our scene. The world component will have an environmental audio which is the theme music of Pokemon being played in the background. You can find the code below or in the repo URL. The new items that are being introduced in this component are AudioModule and Entity.  AudioModule - React 360 gives you a number of ways to play audio, including background environmental audio, one-off sound effects, and spatialized audio. All audio playbacks are controlled through the AudioModule provided by the Native Module.  Entity allows you to render 3D objects, as described in the 3D Object documentation. At the moment, React 360 supports Wavefront OBJ files and GLTF files. The external resource (or resources) containing the model’s information are provided using a source attribute, which is an object of key-value pairs mapping resource types to their locations. The following properties are currently supported: obj - Location of an OBJ-formatted model mtl - Location of a MTL-formatted material (the companion of OBJ) gltf2 - Location of a standalone GLTF2 model
  • 8. Build UI of the Future with React 360 © RapidValue Solutions 8 In the style attribute using transform, we can provide the values for the x, y, z axis for positioning of the object and we are providing the scale value as well. Poke-ball Component The Poke-ball component has a click event and it toggles its design on each click. It also plays a different sound when opened and closed using the audio module’s playOneShot method. You can find the code in the repo URL. The new items that we got introduced to in this are the Interpolate, VrButton and the Props used.  Interpolate is an operation applied on an animated value to transform it from the input value to a corresponding output value.  VrButton is a utility class that detects click-type actions across a variety of input devices. By default, a VrButton has no appearance and will only act as a wrapper to capture events, but it can be styled in the same way as a View.  Props are being passed from the store as well as from the client.js file where we bind the component to runtime. r360.renderToLocation( r360.createRoot('PokeBall1', { position: { x: -1, y: 0, z: -2 }, open: { angle: 125 }, close: { angle: 240 }, pokemon: 'Pikachu' }), r360.getDefaultLocation() ); A snippet from client.js file
  • 9. Build UI of the Future with React 360 © RapidValue Solutions 9 Here, we can see that instead of renderToSurface method that was used in the case of 2D surfaces we created before, we are using renderToLocation method since the 3D models can only be bound to a location with co-ordinates rather than a 2D surface. We are using the getDefaultLocation method to fetch the default location. We can also create custom locations if we want to, based on the demand. The props, like position, are being passed to the component which they are being referred from within the component. Pokemon Component The Pokemon component is responsible for toggling the display of Pokemon which is passed as a prop set in our global store, when we click on the corresponding poke-ball. It also plays the sounds of individual Pokemon when it is summoned or clicked upon. You can find the code in the repo URL. Here, we can see the assets are dynamically loaded, based on the prop name, passed from the component binding to runtime. This ensures the re-usability of the same Pokemon component for loading a different Pokemon. We are now done with creating different components and all that is left is to register them with AppRegistry in index.js, as mentioned in the first screen component and also, binding each component to the runtime in client.js file. You can see the demo and completed code base in the below listed URL’s:  Demo-URL  Git hub-code-base-URL Google Cardboard Support There is no direct support provided by React 360 for Google Cardboard devices but we can provide the support using WebVR or WebXR polyfills. As there seems to be an issue with the current version
  • 10. Build UI of the Future with React 360 © RapidValue Solutions 10 of React 360 and the polyfills, we can’t use that now. Hence, we are limited to the web browser view or VR Devices like Oculus. We hope that this issue gets resolved soon by the React 360 team. The Final Steps Now that we have created our application, these are the final steps that are remaining:  Build We can generate a production build by executing the below command in terminal. npm run bundle After running build, we need to move the static_assets folder into the build directory as this is not automatically taken care of, since assets can be hosted externally as well. To avoid repetition of moving the assets folder into the build directory, we are using a plugin called ncp which is a package provided by npm. We are using that in the script section of our package.json file like shown below: { "scripts": { "start": "node node_modules/react- 360/scripts/packager.js", "bundle": "node node_modules/react-360/scripts/bundle.js", "move-assets": "ncp static_assets build/static_assets", "predeploy": "npm run bundle && npm run move-assets", "deploy": "gh-pages -d build" } }  Deploy Since in this project we are using github pages for hosting our website, we need to configure the github pages plugin in our project (refer online) and execute the below statement in the terminal. npm run deploy Conclusion React 360 can be a good entry level tool for developers who want to build for the users of VR. But in comparison with Aframe, which is a framework for building VR worlds using declarative HTML-like
  • 11. Build UI of the Future with React 360 © RapidValue Solutions 11 components, one might feel React 360 is not at par with Aframe. This is addressed by the React 360 team itself. We believe that React 360 serves a different use case optimized around applications that rely on user interfaces, or are event-driven in nature. By, Arun Anto, Senior Software Engineer, RapidValue
  • 12. Build UI of the Future with React 360 © RapidValue Solutions 12 About RapidValue RapidValue is a global leader in digital product engineering solutions including mobility, omni-channel, IoT, AI, RPA and cloud to enterprises worldwide. RapidValue offers its digital services to the world’s top brands, Fortune 1000 companies and innovative emerging start-ups. With offices in the United States, the United Kingdom, Germany and India and operations spread across the Middle-East, Europe and Canada, RapidValue delivers enterprise services and solutions across various industry verticals. www.rapidvaluesolutions.com www.rapidvaluesolutions.com/blog +1 877.643.1850 contactus@rapidvaluesolutions.com Disclaimer: This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or Reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful.