I have this "small box" in .php file but in html section:
X: <input name="translate_x" id="translate_x" type="text" maxlength="3" value="0" onchange=""/></br>
and in other file, .js, I have :
JSC3D.Matrix3x4.prototype.translate = function(tx, ty, tz) {
console.log("woop");
function changex() {
tx = parseFloat(document.getElementById('translate_x').value) + "<br>";
}
console.log(tx);
this.m03 += tx;
this.m13 += ty;
this.m23 += tz;
};
and console gives me information that changex() function is not defined. What I want to have is, when I type number in text box, it assign value to tx, can anyone help me with this issue ?
/////////////////////////////////////
I made It working perfectly now, here is code :
html file:
X: <input name="translate_x" id="translate_x" type="text" maxlength="3" value="0" onchange=""/></br>
.js file:
JSC3D.Matrix3x4.prototype.translate = function(tx, ty, tz) {
var t=0;
t = parseFloat(document.getElementById('translate_x').value);
console.log(t);
if(t!=0)
{
console.log(this.m03);
this.m03 += tx;
tx=t;
this.m03 += tx;
this.m13 += ty;
this.m23 += tz;
}
else
{
this.m03 += tx;
this.m13 += ty;
this.m23 += tz;
}
};