-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.vr.js
More file actions
128 lines (107 loc) · 3.49 KB
/
Copy pathindex.vr.js
File metadata and controls
128 lines (107 loc) · 3.49 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import React from "react";
import Clock from "./components/clock";
import { AppRegistry, asset, Pano, Text, View, VrHeadModel } from "react-vr";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";
// import { Link } from "react-router-dom";
export default class react_project_360_app extends React.Component {
render() {
return (
<View>
<Pano source={asset("./team-1.jpg")} />
<Clock />
<Text
style={{
// backgroundColor: '#777879',
fontSize: 0.8,
fontWeight: "400",
layoutOrigin: [0.5, 0.5], // x = between -9 or 9; y = between -9 or 9;
paddingLeft: 0.2,
paddingRight: 0.2,
textAlign: "center",
textAlignVertical: "center",
transform: [{ translate: [0, 0, -3] }],
}}
>
Test Text
{/* <Link to={{"http://waltrib.com"}}>Home</Link> */}
</Text>
</View>
);
}
}
// // x y axis
// class WelcomeToVR extends React.Component {
// constructor(props) {
// super(props);
// this.state = {
// aov: VrHeadModel.rotation(),
// colorX: 255,
// colorY: 0,
// };
// // Log available listeners
// console.log(
// "RCT Signals",
// RCTDeviceEventEmitter.addListener().subscriber._subscriptionsForType
// );
// // You may use 'onReceivedHeadMatrix' or others based on your needs
// // but 'onReceivedHeadMatrix' triggers infinitely in browsers.
// RCTDeviceEventEmitter.addListener("onReceivedInputEvent", (e) => {
// // Log what event is happening
// console.log("=============");
// console.log("Event type", e);
// this.setState(
// {
// aov: VrHeadModel.rotation(),
// },
// () => this.generateColors()
// );
// });
// }
// generateColors = () => {
// // Valid color or pass zero to rgb
// const newColorX =
// this.state.aov[0] < 90 ? 255 - Math.abs(this.state.aov[0] * 2.8) : 0;
// const newColorY =
// Math.abs(this.state.aov[1]) < 90 ? Math.abs(this.state.aov[1] * 2.8) : 0;
// const newColorXRounded = Number(newColorX).toFixed(0);
// const newColorYRounded = Number(newColorY).toFixed(0);
// this.setState({
// colorX: newColorXRounded,
// colorY: newColorYRounded,
// });
// };
// render() {
// // For the sake of the example we used rotation
// // But horizontalFov() and verticalFov() are also available.
// const xRotRounded = Number(this.state.aov[0].toFixed(0));
// const yRotRounded = Number(this.state.aov[1].toFixed(0));
// console.log(
// "xRotRounded: " + xRotRounded + "°",
// "yRotRounded: " + yRotRounded + "°"
// );
// return (
// <View>
// <Pano source={asset("team-1.jpg")} />
// <Text
// style={{
// backgroundColor: `rgb(${this.state.colorX}, ${this.state.colorY}, 55)`,
// fontSize: 0.8,
// layoutOrigin: [0.5, 0.5],
// paddingLeft: 0.2,
// paddingRight: 0.2,
// textAlign: "center",
// textAlignVertical: "center",
// transform: [{ translate: [0, 0, -3] }, { scale: 0.5 }],
// }}
// >
// x: {xRotRounded}° y: {yRotRounded}°
// </Text>
// </View>
// );
// }
// }
// AppRegistry.registerComponent("WelcomeToVR", () => WelcomeToVR);
AppRegistry.registerComponent(
"react_project_360_app",
() => react_project_360_app
);