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

You're reading from   Getting Started with React VR Build immersive Virtual Reality apps for the web with React

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781788476607
Length 294 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John Gwinner John Gwinner
Author Profile Icon John Gwinner
John Gwinner
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. What is Virtual Reality, Really? 2. Flatland and Beyond: VR Programming FREE CHAPTER 3. 3D or Reality in Dimensions Other than X and Y 4. The React VR Library 5. Your First VR App 6. Working with Poly and the Gon Family 7. Sitting Down with a (Virtual) Teapot 8. Breath Life in Your World 9. Do It Yourself – Native Modules and Three.js 10. Bringing in the Real Live World 11. Take a Walk on the Wild Side 12. Publishing Your App, and Where to Go from Here

Something more visual


We've done some neat interactivity, which is fantastic, although another big reason to use three.js directly is to do something rendering wise that React VR cannot do. Well, actually, React VR can do some amazing things through Native methods, so let's do exactly that.

First, let's change our cube from bouncing around to spinning as well. It'll look more impressive when we add some of the visual effects.

Let's also add a few spheres around. We'll want some things to reflect. I chose reflection as an impressive thing that you cannot really do in real time with WebVR currently, although we can do something really close to it through environment mapping. For a fairly long discussion of what environment mapping is, you can go to: http://bit.ly/ReflectMap

Add the following code to your existing index.vr.js, below the </VrButton>:

     <Sphere
      radius={0.5}
      widthSegments={20}
      heightSegments={12}
      style={{
        color: 'blue',
        transform...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime