-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathmarker.js
45 lines (43 loc) · 1.18 KB
/
marker.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
import React, { Component } from "react";
import { render } from "react-dom";
import { AFrameRenderer, Marker } from "../src";
/**
* In this example, we use multiple independent markers.
*/
class MultiMarker extends Component {
render() {
return (
<AFrameRenderer
arToolKit={{
sourceType: "image",
sourceUrl: "./images/Multimarker.png"
}}
getSceneRef={ref => (this.scene = ref)}
inherent={true}
>
<Marker parameters={{ preset: "hiro" }}>
<a-box color="blue" position="0 0.09 0" scale="0.4 0.8 0.8">
<a-animation
attribute="rotation"
to="360 0 0"
dur="2000"
easing="linear"
repeat="indefinite"
/>
</a-box>
</Marker>
<Marker parameters={{ preset: "kanji" }}>
<a-box color="red" position="0 0.09 0" scale="0.4 0.8 0.8">
<a-animation
attribute="rotation"
to="360 0 0"
dur="2000"
easing="linear"
repeat="indefinite"
/>
</a-box>
</Marker>
</AFrameRenderer>
);
}
}