-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.js
61 lines (47 loc) · 1.32 KB
/
client.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
// This file contains the boilerplate to execute your React app.
// If you want to modify your application's content, start in "index.js"
import {ReactInstance, Surface,Location} from 'react-360-web';
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
...options,
});
// Render your app content to the default cylinder surface
r360.renderToSurface(
r360.createRoot('Algeria', { /* initial props */ }),
r360.getDefaultSurface()
);
const images = new Surface (
1000 ,
200,
Surface.SurfaceShape.Cylinder
) ;
images.setAngle(
1.4,
0.9
);
r360.renderToSurface(
r360.createRoot('image'),
images
);
// Render the model to the location
const location = new Location([0, -7, -2]);
r360.renderToLocation(
r360.createRoot('image1', { /* initial props */ }),
location
);
const llocation = new Location([5, -3, -7]);
r360.renderToLocation(
r360.createRoot('image2', { /* initial props */ }),
llocation
);
const lllocation = new Location([-5, -3 , -8]) ;
r360.renderToLocation(
r360.createRoot('image3',{/* initial props */},),
lllocation
)
// Load the initial environment
r360.compositor.setBackground(r360.getAssetURL('6.jpg'));
}
window.React360 = {init};