-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
executable file
·81 lines (75 loc) · 2.6 KB
/
Copy patheditor.html
File metadata and controls
executable file
·81 lines (75 loc) · 2.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>modelmagic2 editor</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="/assets/libs/ress/ress.min.css">
<link type="text/css" rel="stylesheet" href="/assets/libs/modelmagic-engine/css/vendor.css">
<link type="text/css" rel="stylesheet" href="/assets/libs/modelmagic-engine/css/editor.css">
</head>
<body>
<div id="root"></div>
<!-- sass compile locally. but very slow use test only.
<script src="/assets/libs/in-browser-sass/in-browser-sass-standalone.min.js"></script>
-->
<!-- modelmagic -->
<script src="/assets/libs/modelmagic-engine/js/vendor.bundle.js"></script>
<script src="/assets/libs/modelmagic-engine/js/vendor-build.bundle.js"></script>
<script src="/assets/libs/modelmagic-engine/js/app.bundle.js"></script>
<script src="/assets/libs/modelmagic-engine/js/editor.bundle.js"></script>
<!-- javascript -->
<script type="module">
import { test0 } from './js/test0.js'
import { test1 } from './js/test1.js'
// modelmagic.editor('createUI')
modelmagic.$on('ready',() => {
console.log('modelmagic.DOMContentLoaded')
})
/*
setTimeout(()=>{
modelmagic.api('env', function(glModule, PlaneMap, XMap){
test0.call(this, glModule)
test1.call(this, glModule)
})
}, 2000)
*/
// config modelmagic
modelmagic.config({
// up: modelmagic._Y_UP_,
fullscreen : true,
canvas : 'main-primary-canvas',
antialias : true,
alpha: true,
powerReference: modelmagic._LOWPOWER_,
showGUI: true,
likeSU : false,
loadQuiet : false,
axesHelper: true,
gridHelper: false,
camera: {
fov: 60,
near : 10,
far: 18000000,
position: { x: 1, y: 10000, z: -1},
lookAt: { x: 1, y: 10, z: -1}
}
// ,view : {
// left : '#view1',
// right : '#view2'
// }
}).$on('init', ()=> {
console.log('got init')
}).$on('cameraAdd', (data) => {
console.log('cameraAdd = ' + data)
}).$on('cameraActive', ( name ) => {
console.log('cameraActive = ' + name)
const type = modelmagic.query('system', 'activeCamera.type')
const src = type === 'PerspectiveCamera' ? '/assets/images/PerspectiveCamera.png'
: (type === 'OrthographicCamera' ? '/assets/images/OrthographicCamera.png' : null)
// if(src)
// document.getElementById('activeCamera').setAttribute('src', src)
}).init()
</script>
</body>
</html>