using this function and beside that more code, everything works perfect, object is always positioned in the center of the screen. But I want to translate object, to move it for example, along Xaxis.
JSC3D.Matrix3x4.prototype.translate = function(tx, ty, tz) {
console.log("woop");
console.log(tx);
this.m03 += tx;
this.m13 += ty;
this.m23 += tz;
console.log(this.m03);
};
So I changed code a bit, I added html code:
X: <input name="translate_x" id="translate_x" type="text" maxlength="3" value="0" onchange="changex()"/></br>
and also I changed .js code:
JSC3D.Matrix3x4.prototype.translate = function(tx, ty, tz) {
console.log("woop");
changex();
console.log(tx);
this.m03 += tx;
this.m13 += ty;
this.m23 += tz;
console.log(this.m03);
};
function changex() {
console.log("changex sada");
tx = parseFloat(document.getElementById('translate_x').value) + "<br>";
}
output is : 0, -15.336091649301977
and object is moving, but without entering any value, it is set to -15.33etc ? ? ?
how can I fix it ?