-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstScene.js
More file actions
103 lines (92 loc) · 2 KB
/
FirstScene.js
File metadata and controls
103 lines (92 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
'use strict';
import React, { Component } from 'react';
import {StyleSheet} from 'react-native';
import {
ViroScene,
ViroARScene,
Viro360Image,
ViroImage,
ViroSphere,
ViroARPlane,
ViroBox,
ViroAnimations,
ViroVideo,
ViroNode,
ViroText
} from '@viro-community/react-viro';
let video = require("./res/vr-2.mp4");
export default class FirstScene extends Component {
constructor(props) {
super(props);
this.state = {}
}
vrScene() {
return (
<ViroScene>
<ViroText
fontSize={40}
text="Hello There"
width={2}
height={2}
position={[0, 0, -1]}
textAlign="center"
textAlignVertical="center"
color="#ffffff"
/>
</ViroScene>
)
}
// VR SECTION
render() {
//return this.vrScene()
return (
<ViroScene style={styles.container}>
<ViroNode>
<ViroVideo
source={video}
volume={1.0}
loop={true}
position={[0, 0, -1]}
scale={[2, 2, 2]}
stereoMode={'leftRight'}
/>
</ViroNode>
</ViroScene>
);
}
// AR SECTION
// render() {
// return (
// <ViroARScene style={styles.container}>
// <Viro360Image source={require('./res/dark_theatre.jpg')} />
//
// <ViroVideo
// source={require("./res/mining.mp4")}
// volume={1.0}
// loop={true}
// position={[0, 3.9, -45]}
// scale={[44, 22, 1]}
// />
// </ViroARScene>
// );
// }
}
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'orange'
},
});
/**
* Declare all your animations here. They'll be referenced by the animation props.
*/
ViroAnimations.registerAnimations({
showTitleAnimation: {
properties: {scaleX: 2, scaleY: 2, scaleZ: 2, opacity: 1.0},
easing: "PowerDecel",
duration: 1000
},
});
module.exports = FirstScene;