Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Getting Started with React VR
Getting Started with React VR

Getting Started with React VR: Build immersive Virtual Reality apps for the web with React

eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Getting Started with React VR

Flatland and Beyond: VR Programming

In the last chapter, you learned about what VR is and what it can be. How is it that programmers and developers (like you) create these virtual worlds? We found out that it is a difficult thing to do right. We have to maintain fast frame rates and proper stereoscopic rendering. How do we do that quickly and easily? Read on and find out how.

In this chapter, we'll cover the following topics:

  • HTML and common programming methods, such as Node.js, JavaScript, and game engines
  • The React Library
  • Graphics libraries, for displaying 2D and 3D images
  • How to install all of these software so that we can begin programming

HTML and ways to move beyond the 2D internet

While the web was developed, the early HTML language has evolved dramatically. A good web page experience typically involves more than just HTML. One of those ways to add more interactivity is via JavaScript. The combination of HTML, XML, and JavaScript is a large portion of what delivers the web, including applications, such as Google Documents or online Microsoft Word (also free).

These are, however, flat. To move into the third dimension has traditionally taken high–speed software, usually written in C++. As computers have gotten faster and faster and Graphics Processing Units (GPU) have taken over the bulk of the actual 3D generation, languages to describe 3D games have evolved.

There are currently quite a number of ways to program in VR. It is challenging to generate 90 frames per second at the resolution the Rift and...

Making servers React

React VR is based on React, a framework that allows web pages and interactive User Interfaces to built by declaration instead of programming. You build views for each state in the application, and then React will use the correct components to display that application.

Declarative views make your code easier, more robust, and easier to modify and debug.

Components use the Object-Oriented concept of encapsulation, meaning they are self-sufficient and manage their own state. You then take these components and use them to make complex UIs.

React allows developers to create applications that change over time, without having to constantly refresh a browser page. It uses the Model-View-Controller design pattern/template and can be used in combination with other JavaScript libraries, such as Angular.JS.

React was first used with Facebook's newsfeed in 2011. It...

Graphics libraries — OpenGL and WebGL

This section covers general 3D programming, but some discussion of different things is in order.

OpenGL is a standard for displaying graphics. Without getting into PC versus Workstation politics (ancient history now), it was a standard that a workstation vendor (SGI) pioneered to standardize computer graphics and the ability for programs to display graphics.

There are other APIs, such as DirectX, which was backed by Microsoft and many PC game developers, CAD software, and other PC computer graphics.

OpenGL is not, strictly speaking, open source; yet the software can be used without royalty payments and is documented and freely available (to be fair, so is DirectX).

Basically, OpenGL is a way for software to display graphics. Software, in this case, usually means C++ (or other languages that can call native libraries and O/S utilities...

Installation of Node.js and React VR

Most desktop VR hardware currently available use Windows; because of this, the following instructions, and indeed most of this book will be a mixture of Windows installations and GearVR viewing. At the time of writing, Linux could be hacked to work with the HTC Vive and Oculus Rift, but it's a difficult road and a bit beyond the scope of this book. Apple PCs are just adding the capability to add an external video card for VR, as most of them simply do not have the video processing capability to render VR at the resolutions used by the Vive and Rift headsets.

React is, however, not PC specific. You could build all of the examples in this book with Linux or a Mac, and follow alongside, and use a Google Daydream, Unofficial Cardboard, or Samsung Gear VR to view all of the samples. In this case, some of the examples may use slightly different...

Summary

In this chapter, we covered the basics of how to actually program VR worlds, and what software to use. We also went through installing the React VR system so that we could develop our own VR worlds! In the next chapter, we'll cover 3D basics and the math that we will need to build our VR worlds.

Don't worry about the math; there won't be a popup quiz.

Now to actually create an interesting world. But first, we need to understand what the world consists of. The next section will describe the React VR terminology to describe your virtual world.

 

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • •A practical guide to developing virtual reality experiences targeting web and mobile browsers
  • •Create customized 3D graphics for your virtual reality experiences with Three.js
  • •Explore the ReactVR library to create objects that seem real and see how they move in the Virtual world
  • •Import free models into VR and include those in your code

Description

This book takes you on a journey to create intuitive and interactive Virtual Reality experiences by creating your first VR application using React VR 2.0.0. It starts by getting you up to speed with Virtual Reality (VR) and React VR components. It teaches you what Virtual Reality (VR) really is, why it works, how to describe 3D objects, the installation of Node.js (version 9.2.0) and WebVR browser. You will learn 3D polygon modeling, texturing, animating virtual objects and adding sound to your VR world. You will also discover ways to extend React VR with new features and native Three.js. You will learn how to include existing high-performance web code into your VR app. This book will also take you through upgrading and publishing your app. By the end of this book, you'll have a deep knowledge of Virtual Reality and a full-fledged working VR app to add to your profile!

Who is this book for?

This book is for web developers who want to use their existing skill set of HTML, CSS, and JavaScript to create virtual reality experiences.

What you will learn

  • • Use Blender 2.79 to make virtual reality objects for Web VR.
  • • Import free models into VR and how to include those in your code
  • • Build a Virtual Museum with interactive art pieces
  • • Create your first VR App and customizing it
  • • Build animations by procedurally changing an object s position, using timers and Animated APIs
  • • Incorporate React Native code and JavaScript code in your VR world

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 30, 2017
Length: 294 pages
Edition : 1st
Language : English
ISBN-13 : 9781788476607
Vendor :
Facebook
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Nov 30, 2017
Length: 294 pages
Edition : 1st
Language : English
ISBN-13 : 9781788476607
Vendor :
Facebook
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 98.97
React 16 Essentials
€24.99
Getting Started with React VR
€36.99
Progressive Web Apps with React
€36.99
Total 98.97 Stars icon

Table of Contents

12 Chapters
What is Virtual Reality, Really? Chevron down icon Chevron up icon
Flatland and Beyond: VR Programming Chevron down icon Chevron up icon
3D or Reality in Dimensions Other than X and Y Chevron down icon Chevron up icon
The React VR Library Chevron down icon Chevron up icon
Your First VR App Chevron down icon Chevron up icon
Working with Poly and the Gon Family Chevron down icon Chevron up icon
Sitting Down with a (Virtual) Teapot Chevron down icon Chevron up icon
Breath Life in Your World Chevron down icon Chevron up icon
Do It Yourself – Native Modules and Three.js Chevron down icon Chevron up icon
Bringing in the Real Live World Chevron down icon Chevron up icon
Take a Walk on the Wild Side Chevron down icon Chevron up icon
Publishing Your App, and Where to Go from Here Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(4 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Athos Delafere Mar 09, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is written in plain English and easy to follow. A fantastic introduction to React VR!
Amazon Verified review Amazon
Gary Meade May 15, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The author gives a very good up-to-date view of the VR industry and good guidelines to a new VR developer. There are small numbers who really understand VR, so insight into the VR world is very limited. Web based VR is only a sliver of the industry pie, but will prove to be a very good pathway for the right project.
Amazon Verified review Amazon
Elaine Ash Jan 17, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
At last, a tech-book written with verve and flair!!! John Gwinner's considerable experience with online communications shines through as he avoids geek-speak and keeps explanations well-grounded for average readers. The book takes nothing for granted and starts off with a clear and concise explanation of virtual reality today, then unlocks the secrets to creating your own VR site and more. Creators will be itching to get started once they see this reader-friendly information, laid out with pictures and explanations. The equipment needed is fairly simple and low-cost as well. The chapters are logical, clear, never staid or boring--Gwinner has a writing voice and style all his own. If you have an interest in VR, or know someone who does, this book is the real deal.
Amazon Verified review Amazon
Paul H. Dunham Jul 05, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am a back-end Javascript developer. I was not familiar with front-end or VR at all. I found this book a great primer for getting started in VR coding. The author makes it easy to understand and easy to build your first app.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.