Popravljeni duhovi, refresh vseh

main
Jurij Podgoršek 2023-06-28 19:04:11 +02:00
parent 77a8d52749
commit 1f5d10d038
5 changed files with 15 additions and 14 deletions

View File

@ -1,5 +1,5 @@
//const SERVER_IP = '192.168.1.101'
const SERVER_IP = '127.0.0.1'
const SERVER_IP = '192.168.1.101'
//const SERVER_IP = '127.0.0.1'
const SERVER_PORT = 6676
const PROTO = 'ws'
@ -10,6 +10,5 @@ const IZBRAN = (window.location.hash.indexOf('kegel') > -1)
console.log('izbran kegel: ', IZBRAN);
const ST_KEGLOV = 2
//const PREPEND = `/ww/0/ww/`
const PREPEND = `/`
const PREPEND = `/ww/0/ww/`
console.log('OSC predpona', PREPEND);

View File

@ -30,7 +30,7 @@ const parametri = [
napis: 'fraktaliziraj',
tip: 'slider',
min: 100,
max: 2000,
max: 2500,
step: 1,
value: 1200,
sprememba: ev => {
@ -75,6 +75,7 @@ const parametri = [
tip: 'button',
sprememba: ev => {
sendAll('/ww/reload')
window.location.reload()
}
},
{

View File

@ -8,12 +8,12 @@ const kbdPressed = {
function inputHandle () {
if (kbdPressed.c) {
calibrate = true;
sendAll('/ww/calibrate');
calibrate = true
sendAll('/ww/calibrate')
}
if (kbdPressed['-']) {
sendAll('/ww/reload');
window.location.reload();
sendAll('/ww/reload')
window.location.reload()
}
if (kbdPressed.d && !cakajDeformiraj) {
deformiraj = !deformiraj

View File

@ -70,7 +70,7 @@ for (let i = 0; i < ST_KEGLOV; i++) {
// Popravki polozajev keglov!
objekti[i].position.x = 12
objekti[i].position.y = -30
objekti[i].position.y = -40
objekti[i].position.z = 20
}
objekti[0].position.z = 20
@ -321,11 +321,11 @@ function objAnim() {
var vsota = Math.abs(acc[IZBRAN].x) + Math.abs(acc[IZBRAN].z)
if (vsota > 2 && !cakajDodatni) {
cakajDodatni = true
var dodatni = objekti[IZBRAN].clone();
var dodatni = objekti[IZBRAN - 1].clone();
dodatni.renderOrder = stevec;
var dodatniMat = objekti[IZBRAN].material.clone();
var dodatniMat = objekti[IZBRAN - 1].material.clone();
//var dodatniBarva = barvaDodatni.clone();
var bId = (IZBRAN == 0) ? 0 : 1
var bId = (IZBRAN == 1) ? 0 : 1
var dodatniBarva = new THREE.Color(barvnePalete[bId][barvnePaleteIdx[bId]])
dodatniMat.color = dodatniBarva;
dodatni.material = dodatniMat;
@ -337,7 +337,7 @@ function objAnim() {
dodatni.premakniKolicina = vsota;
var rQ = qWW[IZBRAN].clone();
rQ.invert();
rQ.multiply(qPrej);
rQ.multiply(qPrej[IZBRAN]);
dodatni.rotirajQ = rQ;
//dodatni.qStart = kegel.quaternion.clone();

View File

@ -49,6 +49,7 @@ for (let i = 1; i <= ST_KEGLOV; i++) {
}
oscCallbacks[`${PREPEND}${i}/accel`] = function (args) {
[acc[i].x, acc[i].y, acc[i].z] = args.map(getVal)
//console.log('ACC', i, acc[i])
}
oscCallbacks[`${PREPEND}${i}/gyro`] = function (args) {
[rotacija[i].x, rotacija[i].y, rotacija[i].z] = args.map(getVal)