Nekaj popravkov
parent
7c1fc1b321
commit
2851a67eca
17
anim.js
17
anim.js
|
@ -179,7 +179,7 @@ function objAnim() {
|
|||
function addObj(w, h) {
|
||||
var col = new THREE.Color();
|
||||
//col.setHSL(stevec * barva_mod, saturacija, svetlost);
|
||||
col.setHSL(stevec * barva_mod, saturacija, (Math.sin(stevec/barvapuls) / 6) + 0.3);
|
||||
col.setHSL(stevec * barva_mod, saturacija, (Math.sin(stevec/barvapuls) / 6) + 0.5);
|
||||
|
||||
var mat = new THREE.LineBasicMaterial({
|
||||
color: col
|
||||
|
@ -219,16 +219,15 @@ qK = new THREE.Quaternion()
|
|||
|
||||
function camRotate () {
|
||||
//scene.setRotationFromQuaternion(qKamera)
|
||||
scene.rotation.x += crotacijaX
|
||||
scene.rotation.y += crotacijaY
|
||||
scene.rotation.z += crotacijaZ
|
||||
scene.rotation.x += crotacijaX;
|
||||
scene.rotation.y += crotacijaY;
|
||||
scene.rotation.z += crotacijaZ;
|
||||
}
|
||||
|
||||
// Inicializiraj
|
||||
document.onreadystatechange = function () {
|
||||
if (document.readyState === 'complete') {
|
||||
document.getElementById("anim-container").appendChild(renderer.domElement);
|
||||
|
||||
render();
|
||||
}
|
||||
};
|
||||
|
@ -256,13 +255,13 @@ const kbdPressed = {
|
|||
|
||||
window.addEventListener('keydown', (e) => {
|
||||
kbdPressed[e.key] = true;
|
||||
})
|
||||
});
|
||||
|
||||
window.addEventListener('keyup', (e) => {
|
||||
if (e.key in kbdPressed) {
|
||||
kbdPressed[e.key] = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var prepend = '/ww/0';
|
||||
|
||||
|
@ -274,8 +273,6 @@ oscCallbacks[prepend + '/keys'] = function(args) {
|
|||
keysPressed[1] |= kbdPressed['s'];
|
||||
keysPressed[2] |= kbdPressed['d'];
|
||||
keysPressed[3] |= kbdPressed['f'];
|
||||
//console.log(keysPressed, kbdPressed);
|
||||
console.log(args)
|
||||
};
|
||||
oscCallbacks[prepend + '/quaternion'] = function (args) {
|
||||
// Popravimo osi (w x y z po defaultu HMM)
|
||||
|
@ -286,7 +283,7 @@ oscCallbacks[prepend + '/quaternionDiff'] = function (args) {
|
|||
};
|
||||
oscCallbacks[prepend + '/eulerDiff'] = function (args) {
|
||||
[dqX, dqY, dqZ] = args.map(getVal);
|
||||
}
|
||||
};
|
||||
/* Ne uporabljamo vec
|
||||
|
||||
'/gyro/': [
|
||||
|
|
21
osctl.js
21
osctl.js
|
@ -3,23 +3,14 @@ var oscPort = new osc.WebSocketPort({
|
|||
metadata: true
|
||||
});
|
||||
|
||||
oscPort.open();
|
||||
|
||||
oscPort.on("ready", function () {
|
||||
console.log("OSC listening!")
|
||||
// Example send
|
||||
/*
|
||||
oscPort.send({
|
||||
address: "/carrier/frequency",
|
||||
args: [
|
||||
{
|
||||
type: "f",
|
||||
value: 440
|
||||
}
|
||||
]
|
||||
});
|
||||
*/
|
||||
oscPort.on("message", function (msg) {
|
||||
oscCallbacks[msg.address].forEach(cb => cb(msg.args))
|
||||
var cb = oscCallbacks[msg.address]
|
||||
if (cb) {
|
||||
cb(msg.args)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
oscPort.open();
|
||||
|
|
Loading…
Reference in New Issue