-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
66 lines (61 loc) · 1.31 KB
/
index.js
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
import React from 'react';
import {
AppRegistry,
Text,
View,
VrButton,
asset,
AmbientLight,
PointLight
} from 'react-360';
import Entity from 'Entity';
export default class React3DView extends React.Component {
render() {
return (
<View>
<AmbientLight intensity={0.5} />
<PointLight style={{color: 'white', transform: [{translate: [0, 400, 700]}]}} />
<Entity
source={{
obj: asset('creature.obj'),
mtl: asset('creature.mtl'),
}}
lit={true}
style={{
transform: [
{translate: [0, -20, -90]},
{scale: 0.1},
{rotateY: 0},
{rotateX: -90},
],
}}
/>
<Entity
source={{
obj: asset('cilinder.obj'),
mtl: asset('cilinder.mtl'),
}}
lit={true}
style={{
transform: [
{translate: [120, -120, -100]},
],
}}
/>
<Entity
source={{
obj: asset('pyramid.obj'),
mtl: asset('pyramid.mtl'),
}}
lit={true}
style={{
transform: [
{translate: [50, -50, 400]},
],
}}
/>
</View>
);
}
};
AppRegistry.registerComponent('React3DView', () => React3DView);