0

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 ?

commandos2389
  • 175
  • 1
  • 10
  • the JSC3D.Matrix3x4 class is not the right place to do that kind of implementation, please see my answer to your previous post: [http://stackoverflow.com/questions/32454569/jsc3d-translating-object](http://stackoverflow.com/questions/32454569/jsc3d-translating-object) – deblocker Sep 11 '15 at 21:29
  • your solution is very good, i like it but I want to make mixture between those two, I would like that I can move single mesh when I have more than one at the scene, and also i want to move it using – commandos2389 Sep 11 '15 at 21:43

0 Answers0