Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

PID PID RA PID RA PID Cross Platform Cross Platform ATIVE ATIVE REACT NATIVE REACT NATIVE WITH WITH WITH WITH Alex Hinson n @amhinson

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

PID PID RA PID RA PID Cross Platform Cross Platform ATIVE ATIVE REACT NATIVE REACT NATIVE WITH WITH WITH WITH Alex Hinson n @amhinson

Slide 6

Slide 6 text

Y WHY How What

Slide 7

Slide 7 text

What is AR ?

Slide 8

Slide 8 text

creates a virtual environment that is closed off to the real world places virtual objects in the real world

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Why AR Right Now ?

Slide 11

Slide 11 text

expensive / inaccessible quality hardware cutting edge gaming

Slide 12

Slide 12 text

ARKit & ARCore Pokemon GO, Instagram, Snapchat

Slide 13

Slide 13 text

How Does AR Work ?

Slide 14

Slide 14 text

Tracking dering Rendering

Slide 15

Slide 15 text

3d rendering lighting & shadows physics animations Rendering

Slide 16

Slide 16 text

built by Apple not cross platform SceneKit

Slide 17

Slide 17 text

built for games cross platform not JS or React based Unity / Unreal

Slide 18

Slide 18 text

cross platform JS/React based

Slide 19

Slide 19 text

What is Viro ?

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

ARKit & ARCore Cardboard, Daydream, & Gear VR

Slide 22

Slide 22 text

Why would you use Viro ?

Slide 23

Slide 23 text

ar Familiar l Powerful Accessible

Slide 24

Slide 24 text

How does viro work ?

Slide 25

Slide 25 text

high performance native 3D rendering engine custom React Native components

Slide 26

Slide 26 text

Viro Viro d Testbed App App

Slide 27

Slide 27 text

warning: lots of code ahead Examples

Slide 28

Slide 28 text

Slide 29

Slide 29 text

// …

Slide 30

Slide 30 text

onInitialized = (state) => { if (state === ViroConstants.TRACKING_NORMAL) { this.setState({ tracking: true }); } };

Slide 31

Slide 31 text

{this.state.tracking && ( )}

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

{this.state.tracking && ( )}

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

SHapes

Slide 36

Slide 36 text

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

ViroMaterials.createMaterials({ white: { lightingModel: 'Blinn', diffuseColor: 'rgb(231,231,231)' } });

Slide 39

Slide 39 text

// ...

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

// ... ViroMaterials.createMaterials({ moon: { shininess: 2.0, lightingModel: 'Blinn', diffuseTexture: require('./res/moon.jpg') } });

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

this.setState({ x: position[0], y: position[1], z: position[2] }) } position={[this.state.x, this.state.y, this.state.z]} materials={['moon']} />

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

ViroAnimations.registerAnimations({ spin: { properties: { rotateY: '+=45' }, duration: 2000 } });

Slide 49

Slide 49 text

this.setState({ x: position[0], y: position[1], z: position[2] }) } position={[this.state.x, this.state.y, this.state.z]} materials={['moon']} animation={{ name: 'spin', run: true, loop: true }} />

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Custom 3d Obj ects

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

final ARScene scene = new ARScene(); scene.setListener(new ARScene.Listener() { public void onAnchorFound(ARAnchor anchor, ARNode arNode) { // Make sure anchor is a plane if (anchor.getType() == ARAnchor.Typea.PLANE) { ARPlaneAnchor planeAnchor = (ARPlaneAnchor) anchor; // Ensure this is a horizontal plane of the right size if (planeAnchor.getAlignment() == ARPlaneAnchor.Alignment.HORIZONTAL && planeAnchor.getWidth() > 1.0 && planeAnchor.getHeight() > 1.0) { Object3D dinosaur = new Object3D(); dinosaur.loadModel("file://android-asset/dinosaur.fbx", Object3D.Type.FBS); arNode.addChildNode(dinosaur); } } } });

Slide 57

Slide 57 text

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

// ... Viro3DObject

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

this.setState({ runAnimation: true }) } animation={{ name: 'move', run: this.state.runAnimation, loop: true }} />

Slide 63

Slide 63 text

ViroAnimations.registerAnimat ions({ move: { properties: { positionZ: '+=0.2' }, duration: 1000 } });

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Portals

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

Image Recognition

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

this.setState({ runAnimation: true }) } > // ... Objects to render when target is found

Slide 74

Slide 74 text

ViroARTrackingTargets.createTargets({ airshipLogo: { source: require('./res/logo.png'), orientation: 'Up', physicalWidth: 0.03 } });

Slide 75

Slide 75 text

ViroAnimations.registerAnimations({ slideUp: { properties: { positionZ: 0, opacity: 1.0 }, easing: 'Bounce', duration: 700 }, rotate: { properties: { rotateZ: '+=45' }, duration: 200 } });

Slide 76

Slide 76 text

Slide 77

Slide 77 text

this.setState({ runAnimation: true })}> // … ViroARTrackingTargets.createTargets({ airshipLogo: { source: require('./res/mark_with_bg.png'), orientation: 'Up', physicalWidth: 0.03 } }); ViroAnimations.registerAnimations({ slideUp: { properties: { positionZ: 0, opacity: 1.0 }, easing: 'Bounce', duration: 700 }, rotate: { properties: { rotateZ: ‘+=45' }, duration: 200 } });

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

Object Recognition

Slide 85

Slide 85 text

// ... Something to render // ... ViroARTrackingTargets.createTargets({ tvRemote: { source: require('./res/tvRemote.arobject'), type: 'Object' }, dvdRemote: { source: require('./res/dvdRemote.arobject'), type: 'Object' } });

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

const TARGETS = [ { displayText: 'TV', targetName: 'tvRemote' }, { displayText: 'DVD', targetName: 'dvdRemote' } ]; // ... {TARGETS.map(target => ( ))}

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

Viro & react NAtive

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

Score: {this.state.score} Restart

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

state = { dollarBills: [] }; // ... // Inside setInternal this.setState(({ dollarBills }) => ({ dollarBills: [ ...dollarBills, { position: this.randomXYZNumber(-2, 2), rotation: this.randomXYZNumber(-45, 45) } ] }));

Slide 94

Slide 94 text

dollarBills.map((item, index) => ( this.onDollarSelected(index)} height={0.2} length={0.01} width={0.6} materials={['billFace']} /> ))

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

github.com/amhinson/ar-demo Demo A pp

Slide 98

Slide 98 text

repo: github.com/amhinson/ar-demo Thanks Alex Hinson @amhinson

Slide 99

Slide 99 text

No content