-
Notifications
You must be signed in to change notification settings - Fork 39
/
main.js
37 lines (31 loc) · 1019 Bytes
/
main.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
window.onload = function() {
var size = 512
var canvas = document.createElement('canvas');
canvas.width = size;
canvas.height = size;
canvas.style.border = 'solid black 1px';
document.body.appendChild(canvas);
var mmd = new MMD(canvas, canvas.width, canvas.height);
mmd.initShaders();
mmd.initParameters();
mmd.registerKeyListener(document);
mmd.registerMouseListener(document);
var miku = new MMD.Model('model', 'Miku_Hatsune_Ver2.pmd');
//var miku = new MMD.Model('Lat', 'Normal.pmd');
//var miku = new MMD.Model('mobko', 'mobko.pmd');
//var miku = new MMD.Model('yufu', 'yufu.pmd');
//var miku = new MMD.Model('defoko', 'defoko.pmd');
miku.load(function() {
mmd.addModel(miku);
mmd.initBuffers();
mmd.start();
var dance = new MMD.Motion('motion/kishimen.vmd');
dance.load(function() {
mmd.addModelMotion(miku, dance, true);
mmd.play()
setInterval(function() {
console.log('fps = ' + mmd.realFps);
}, 1000);
});
});
};