three.js switch materials as camaro materials - function

I test the material switch on three.js and I have seen material camaro ici :
http://mrdoob.github.com/three.js/examples/webgl_materials_cars_camaro.html
But if I think understand the code, I tried to reproduce it with a single object that has a single material
and clicking on the button changes the material.
But I have two problems:
- How to create a variation of material with a texture
- After 3 days of testing, my code does not work and I do not understand why
if you could tell me where it gets stuck and why:
/////////////////////// MATERIAL /////////////////////////////
var materials = {
Red: new THREE.MeshLambertMaterial( {
color: 0x660000,
envMap: textureCube,
combine: THREE.MixOperation,
reflectivity: 0.5
} ),
Black: new THREE.MeshLambertMaterial( {
color: 0x000000,
envMap: textureCube,
combine: THREE.MixOperation,
reflectivity: 0.5
} ),
White: new THREE.MeshLambertMaterial( {
color: 0xffffff,
envMap: textureCube,
combine: THREE.MixOperation,
reflectivity: 0.5
} ),
Gold: new THREE.MeshPhongMaterial( {
color: 0xaa9944,
specular: 0xbbaa99,
shininess: 50,
envMap: textureCube,
combine: THREE.MultiplyOperation
} ),
Chrome: new THREE.MeshPhongMaterial( {
color: 0xffffff,
specular:0xffffff,
envMap: textureCube,
combine: THREE.MultiplyOperation
} ),
// how to configure this material ?
/*LWood: new THREE.ImageUtils.loadTexture ( texture );
url = "models/macabann/chataigner.jpg";
imgTexture.repeat.set( 4, 4 );
imgTexture.wrapS = imgTexture.wrapT = THREE.RepeatWrapping;
imgTexture.anisotropy = 16;
shininess: 50;
specular: 0x333333;
envMap: textureCube;
combine: THREE.MixOperation;
reflectivity: 0.2;
bumpScale: 1;
shading: THREE.SmoothShading;*/
/*DWood: new THREE.ImageUtils.loadTexture ( texture );
url = "models/macabann/chataigner.jpg";
imgTexture.repeat.set( 4, 4 );
imgTexture.wrapS = imgTexture.wrapT = THREE.RepeatWrapping;
imgTexture.anisotropy = 16;
shininess: 50;
specular: 0x333333;
envMap: textureCube;
combine: THREE.MixOperation;
reflectivity: 0.2;
bumpScale: 0;
shading: THREE.SmoothShading;*/
};
/////////////////////// FIN MATERIAL /////////////////////////////
////////////////////////// OBJET ////////////////////////////
var loader = new THREE.JSONLoader();
loader.load('models/macabann/bielo.js', function ( geometry )
{ createScene( geometry, materials ) }
);
function createScene( geometry, materials ) {
var Bmaterial = new THREE.MeshLambertMaterial();
Bmaterial = materials [ "Orange" ];// default cette ligne merde
var mesh = new THREE.Mesh( geometry, Bmaterial );
mesh.scale.set(1, 1, 1);
mesh.position.y = 0;
mesh.position.x = 0;
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add( mesh );
createButtons( materials, Bmaterial );
}
///////////////////// FIN OBJET ///////////////////////
//////////////////// buttons //////////////////////////
function createButtons( materials, Bmaterial ) {
var buttons = document.getElementById( "buttons" );
for ( var key in materials ) {
var button = document.createElement( 'button' );
button.textContent = key;
button.addEventListener( 'click', function ( event ) {
Bmaterial = materials[ this.textContent ];///////problem ?
}, false
);
buttons.appendChild( button );
}
}
thanks to answers

This code is incorrect
function createScene( geometry, materials ) {
var m = new THREE.MeshLambertMaterial();
m.materials = Bmaterial [ "Orange" ];
var mesh = new THREE.Mesh( geometry, m );
It should be
function createScene( geometry, materials ) {
var m = Bmaterial [ "Orange" ];
var mesh = new THREE.Mesh( geometry, m );
Also, you can't change from a less complicated material to a more complicated one. For example, if one material has a texture, they all must. See https://github.com/mrdoob/three.js/wiki/Updates.
So make all your materials in you material array MeshPhongMaterial. If one material does not need a texture, then assign it a dummy white one.

Related

How to load .OBJ and .MTL using ThreeJS? (HTML)

I'm trying to load a 3D globe into my HTML site using a ThreeJS script (found below) But it's stitched together with code from other sources, meaning the camera is mapped to MouseX and MouseY positions. I want the object to sit in the center of the page with a simple slow spin, but every time I try and achieve this the object vanishes.
The Javascript:
<script>
var container;
var camera, scene, renderer;
var mouseX = 0, mouseY = 0;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
init();
animate();
function init() {
container = document.createElement( 'div' );
document.body.appendChild( container );
camera = new THREE.PerspectiveCamera( 5, window.innerWidth / window.innerHeight, 1, 5000 );
camera.position.z = 250;
scene = new THREE.Scene();
var ambientLight = new THREE.AmbientLight( 0xcccccc, 0.8 );
scene.add( ambientLight );
var pointLight = new THREE.PointLight( 0xFFF1CF, 0.6 , 0 );
camera.add( pointLight );
scene.add( camera );
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {
console.log( item, loaded, total );
};
var onProgress = function ( xhr ) {
if ( xhr.lengthComputable ) {
var percentComplete = xhr.loaded / xhr.total * 100;
console.log( Math.round(percentComplete, 2) + '% downloaded' );
}
};
var onError = function ( xhr ) {;
};
var mtlLoader = new THREE.MTLLoader();
mtlLoader.load('planet.mtl', function(materials) {
materials.preload();
var objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials);
objLoader.load('planet.obj', function(object) {
object.position.y = 0;
scene.add(object);
}, onProgress, onError);
});
//
renderer = new THREE.WebGLRenderer( {alpha: true});
renderer.setClearColor( 0x000000, 0 );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
document.addEventListener( 'mousemove', onDocumentMouseMove, false );
document.addEventListener( 'mouseclick', onmousedown, false);
//
window.addEventListener( 'resize', onWindowResize, false );
}
function onWindowResize() {
windowHalfX = window.innerWidth / 2;
windowHalfY = window.innerHeight / 2;
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
function onDocumentMouseMove( event ) {
mouseX = ( event.clientX );
mouseY = ( event.clientY );
}
//
function animate() {
requestAnimationFrame( animate );
render();
}
function render() {
camera.position.x += ( mouseX - camera.position.x ) * .05;
camera.position.y += ( - mouseY - camera.position.y ) * .05;
camera.lookAt( scene.position );
renderer.render( scene, camera );
}
</script>
You need to change your code a little bit,
In the 'init' function, change the object loading logic as follows
var mtlLoader = new THREE.MTLLoader();
var objLoader = new THREE.OBJLoader();
mtlLoader.load( 'planet.mtl', function(materials) {
materials.preload();
objLoader.setMaterials(materials);
objLoader.load( 'planet.obj', function( object ){
object.position.set( 0, 0, 0 ); // set the position as (0,0,0)
globe = object; // globe is the object to be added to the scene
scene.add(globe);
animate(); //call the animate function only after the object is loaded
}, onProgress, onError);
} );
And change the render method,
function render() {
globe.rotation.y += 0.01; // this will rotate the object
camera.lookAt( scene.position );
renderer.render( scene, camera );
}

Transform one object w/ the matrix4() of another (THREE.js r84)

I wish to move a cube based on the movement of another cube to which TransformControls is attached by means of Matrix4() method only.
The attempts so far have failed to shift the follower cube.
I'm not sure why the follower doesn't seem to take the world co-ordinates of the directing cube.
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - transform controls</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0px;
background-color: #000000;
color: #fff;
font-family:Monospace;
text-align: center;
font-size: 15px;
line-height: 30px;
overflow: hidden;
}
#info {
position: absolute;
top: 0px; width: 100%;
padding: 15px;
z-index:100;
}
</style>
</head>
<body>
<div id="info">
"W" translate | "E" rotate | "R" scale | "+" increase size | "-" decrease size<br />
Press "Q" to toggle world/local space, keep "Ctrl" down to snap to grid
</div>
<script src="build/three.js"></script>
<script src="js/controls/TransformControls.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script>
var camera, scene, renderer, control, mesh, mesh1;
init();
animate();
//render();
//update();
function init() {
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.sortObjects = false;
document.body.appendChild( renderer.domElement );
//
camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 3000 );
camera.position.set( 1000, 500, 1000 );
camera.lookAt( new THREE.Vector3( 0, 200, 0 ) );
scene = new THREE.Scene();
scene.add( new THREE.GridHelper( 1000, 10 ) );
var light = new THREE.DirectionalLight( 0xffffff, 2 );
light.position.set( 1, 1, 1 );
scene.add( light );
//var texture = new THREE.TextureLoader().load( 'textures/crate.gif', render );
//texture.mapping = THREE.UVMapping;
//texture.anisotropy = renderer.getMaxAnisotropy();
var geometry = new THREE.BoxGeometry( 200, 200, 200 );
var material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
control = new THREE.TransformControls( camera, renderer.domElement );
control.addEventListener( 'change', render );
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
control.attach( mesh );
scene.add( control );
var followerCube = new THREE.BoxGeometry( 200, 200, 200 );
var material1 = new THREE.MeshBasicMaterial( { color: 0xff9909 } );
mesh1 = new THREE.Mesh( followerCube, mesh1 );
scene.updateMatrixWorld();
mesh1.matrixAutoUpdate = false;
var relativeMeshOffset = new THREE.Vector3( 100, 100, 200 );
var offsetPosition = relativeMeshOffset.applyMatrix4( mesh.matrixWorld );
mesh1.position.x = offsetPosition.x;
mesh1.position.y = offsetPosition.y;
mesh1.position.z = offsetPosition.z;
scene.add( mesh1 );
console.log(mesh1.position);
var orbitControl = new THREE.OrbitControls( camera, renderer.domElement );
orbitControl.addEventListener( 'change', render );
window.addEventListener( 'resize', onWindowResize, false );
window.addEventListener( 'keydown', function ( event ) {
switch ( event.keyCode ) {
case 81: // Q
control.setSpace( control.space === "local" ? "world" : "local" );
break;
case 17: // Ctrl
control.setTranslationSnap( 100 );
control.setRotationSnap( THREE.Math.degToRad( 15 ) );
break;
case 87: // W
control.setMode( "translate" );
break;
case 69: // E
control.setMode( "rotate" );
break;
case 82: // R
control.setMode( "scale" );
break;
case 187:
case 107: // +, =, num+
control.setSize( control.size + 0.1 );
break;
case 189:
case 109: // -, _, num-
control.setSize( Math.max( control.size - 0.1, 0.1 ) );
break;
}
});
window.addEventListener( 'keyup', function ( event ) {
switch ( event.keyCode ) {
case 17: // Ctrl
control.setTranslationSnap( null );
control.setRotationSnap( null );
break;
}
});
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
render();
}
function animate() {
requestAnimationFrame( animate );
render();
update();
}
function update() {
var relativeMeshOffset = new THREE.Vector3( 100, 100, 200 );
var offsetPosition = relativeMeshOffset.applyMatrix4( mesh.matrixWorld );
mesh1.position.x = offsetPosition.x;
mesh1.position.y = offsetPosition.y;
mesh1.position.z = offsetPosition.z;
}
function render() {
control.update();
renderer.render( scene, camera );
}
</script>
</body>
</html>
Cause you set mesh1.matrixAutoUpdate = false; in line 75. If you do that, the mesh1 wouldn't change its position.

Load js model into three js project

I used the following code (which is not mine, it's taken from this article http://blog.andrewray.me/how-to-export-a-rigged-animated-model-from-3ds-max-three-js/) in my project and tried to load my model. But the ptoblem is that the author uses animated skinned mesh, I have a simple model. I copied his complete demo page code to my project, changed the path to the js model and it doesn't show up. What should I adjust to make it work?
var container;
var camera, scene, renderer, objects;
var particleLight, pointLight;
var mesh, wiggly;
var loader = new THREE.JSONLoader();
loader.load( './humpback-whale-animated-threejs-max-exporter.js', function ( geometry, materials ) {
var originalMaterial = materials[ 0 ];
originalMaterial.skinning = true;
mesh = new THREE.SkinnedMesh( geometry, originalMaterial );
mesh.scale.set( 0.1, 0.1, 0.1 );
var animation = new THREE.Animation(
mesh,
geometry.animation
);
animation.play();
init();
animate();
});
function init() {
container = document.createElement( 'div' );
document.body.appendChild( container );
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
scene = new THREE.Scene();
scene.add( mesh );
// Lights
scene.add( new THREE.AmbientLight( 0xcccccc ) );
var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee );
directionalLight.position.x = Math.random() - 0.5;
directionalLight.position.y = Math.random() - 0.5;
directionalLight.position.z = Math.random() - 0.5;
directionalLight.position.normalize();
scene.add( directionalLight );
pointLight = new THREE.PointLight( 0xffffff, 4 );
scene.add( pointLight );
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
window.addEventListener( 'resize', onWindowResize, false );
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
var clock = new THREE.Clock();
function animate() {
requestAnimationFrame( animate );
render();
}
function render() {
var delta = clock.getDelta();
var timer = Date.now() * 0.0005;
THREE.AnimationHandler.update( delta );
camera.position.x = Math.cos( 0.5 ) * 20;
camera.position.y = 5;
camera.position.z = Math.sin( 0.5 ) * 20;
camera.lookAt( scene.position );
renderer.render( scene, camera );
}
I know there are different loaders in three.js and I don't know which one to use for a simple static textured mesh.

three.js json loadingmanager model not displayed

I want to preload all models and textures with a loadingbar in my project. For that i use the LoadingManger from three.js but i have problems with preloading the json Models. They load but i am unable to display them. Here is an example.
You can see in the console that 200 Meshs are created. 100 For the Asteroids and 100 for the Ships.
Withoud the LoadingManger i can display the models (asteroids) so there should be no problem with the model. You can see in the example Asteroids that are loaded without the loading manager.
Here my simplified code for the problem
$(function(){
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
var debugScene = true;
var controler, camera, controls, scene, renderer;
var objectControls;
var ship1geometry,ship1material;
////////////////////////////////////////////////////////
//LOADMANGER
////////////////////////////////////////////////////////
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {
$('#loader').css({width:(Math.round(loaded / total *100))+"%"});
console.log( item, loaded, total );
};
manager.onLoad = function () {
$('#loaderholder').fadeOut(function(){
init();
animate();
});
console.log('all items loaded');
};
manager.onError = function () {
console.log('there has been an error');
};
var loader = new THREE.JSONLoader(manager); // init the loader util
loader.load('models/shiptest.json', function (ship1geometry) {
var ship1material = new THREE.MeshFaceMaterial();
}, "models");
function init() {
var width = window.innerWidth;
var height = window.innerHeight;
camera = new THREE.PerspectiveCamera( 45, width / height, 1, 10000000 );
camera.position.x = 0;
camera.position.y = 0;
camera.position.z = 1500;
scene = new THREE.Scene();
renderer = new THREE.WebGLRenderer();
renderer.setClearColor("black");
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.autoClear = false;
var container = document.getElementById( 'container' );
container.appendChild( renderer.domElement );
controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.enableDamping = true;
controls.dampingFactor = 0.25;
controls.enableZoom = false;
controls.minDistance = 50;
controls.maxDistance = 300000;
controls.autoRotate = false;
controls.autoRotateSpeed = 0.05;
controls.target.x = 0;
controls.target.y = 0;
controls.target.z = 0;
light = new THREE.AmbientLight( 0x666666 );
scene.add( light );
light = new THREE.PointLight( 0xffffff, 1, 10000 );
light.position.set( 0, 0, 0 );
var params = { recursive: true };
objectControls = new ObjectControls( camera, params );
shipCount = 100;
for (var p = 0; p < shipCount; p++) {
var pX = Math.random() * 5000 - 2500;
var pZ = Math.random() * 5000 - 2500;
var ship = createShipMesh(pX,0,pZ,0,0,0,ship1geometry,ship1material);
scene.add(ship);
}
var loader = new THREE.JSONLoader();
loader.load('models/asteroid.json', function (geometry, mat) {
var material = new THREE.MeshFaceMaterial( mat );
asteroidCount = 100;
for (var p = 0; p < asteroidCount; p++) {
var pX = Math.random() * 5000 - 2500;
var pZ = Math.random() * 5000 - 2500;
var mesh = new THREE.Mesh(geometry,material);
mesh.rotation.y = -Math.PI/Math.random();
mesh.position.set( pX, 0, pZ );
scene.add(mesh);
}
}, "textures");
window.addEventListener( 'resize', onWindowResize, false );
if(debugScene){
var gridHelper = new THREE.GridHelper( 900000, 10000 );
gridHelper.setColors( 0x0000ff, 0x808080 );
scene.add( gridHelper );
var axisHelper = new THREE.AxisHelper( 500 );
scene.add( axisHelper );
console.log(scene);
}
}
function onWindowResize() {
var width = window.innerWidth;
var height = window.innerHeight;
camera.aspect = width / height;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
var lastTimeMsec= null;
var nowMsec= null;
function animate() {
requestAnimationFrame( animate );
render();
update();
}
function update(){
controls.update();
objectControls.update();
}
function render() {
renderer.render( scene, camera );
}
function createShipMesh(positionX,positionY,positionZ,centerX,centerY,centerZ,geometry,material){
positionX = centerX + positionX;
positionY = centerY + positionY;
positionZ = centerZ + positionZ;
var mesh = new THREE.Mesh(geometry,material);
mesh.rotation.y = -Math.PI/Math.random();
mesh.position.set( positionX, positionY, positionZ );
objectControls.add( mesh );
mesh.select = function(){
controls.target.x = position.x;
controls.target.y = position.y;
controls.target.z = position.z;
controls.dollyIn(2);
controls.minDistance = 20;
}
return mesh;
}
});
Okay i found the problem on my own. the Loading Manager works with json but my mistake was to set the variable ship1geometry global and was thinking that the loader would overwrite this variable so that i can use it later in the scene. That was wrong. I just needed to assign the response from the loader in my globaly set variable. So here is the right code
var ship1geometry,ship1material
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {
$('#loader').css({width:(Math.round(loaded / total *100))+"%"});
console.log( item, loaded, total );
};
manager.onLoad = function () {
$('#loaderholder').fadeOut(function(){
init();
animate();
});
console.log('all items loaded');
};
manager.onError = function () {
console.log('there has been an error');
};
var loader = new THREE.JSONLoader(manager); // init the loader util
loader.load('models/shiptest.json', function (geometry,mat) {
ship1geometry = geometry;
ship1material = new THREE.MeshLambertMaterial({map:mat });
}, "textures");
function init(){
...
}

Three.js - Trying to display an animation on browser

I am trying to display an animation, in which an avatar moves her both arms. I created the animation on Blender (v2.75) and exported to JSON (r71). The result: the avatar appears on browser, but there is no animation (no movements of arms). Here is the code: jsfiddle and below is the complete code. Can someone help me please?
<html>
<head>
<title>My first Three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
<script src="models/three.js"></script>
<script>
var camera, light, renderer, objeto, animation, helpset, clock, animacao;
var loader;
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
scene.add( new THREE.AmbientLight( 0x666666 ) );
light = new THREE.DirectionalLight( 0xdfebff, 1.75 );
light.position.set( 50, 200, 100 );
light.position.multiplyScalar( 1.3 );
light.castShadow = true;
//light.shadowCameraVisible = true;
light.shadowMapWidth = 1024;
light.shadowMapHeight = 1024;
var d = 300;
light.shadowCameraLeft = -d;
light.shadowCameraRight = d;
light.shadowCameraTop = d;
light.shadowCameraBottom = -d;
light.shadowCameraFar = 1000;
light.shadowDarkness = 0.5;
scene.add( light );
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
camera.position.z = 5;
clock = new THREE.Clock();
loader = new THREE.JSONLoader();
loader.load( 'models/SL-MD-avatar_erica95.json', addModel );
function addModel( geometry, materials ){
materials[0].skinning = true;
// materials[0].color = "0xb091cc";
var m = new THREE.MeshLambertMaterial(materials);
// console.log(materials[0]);
objeto= new THREE.SkinnedMesh( geometry, m);
objeto.castShadow = true;
objeto.receiveShadow = true;
helpset = new THREE.SkeletonHelper(objeto);
//scene.add(helpset);
// console.log(geometry.animations[0]);
animacao = objeto.geometry.animations[0];
var nome = objeto.geometry.animations[0]["name"];
console.log (nome);
var animation = new THREE.Animation (objeto, animacao);
console.log(animation);
animation.play();
console.log(animation.isPlaying);
scene.add(objeto);
// console.log(animation.data);
}
}
function render() {
delta = 0.75 * clock.getDelta();
scene.traverse(function(child) {
if (child instanceof THREE.SkinnedMesh){
child.rotation.y += .01;
}
});
THREE.AnimationHandler.update( delta );
}
function animate(){
requestAnimationFrame(animate);
render();
renderer.render(scene, camera);
}
init();
animate();
</script>
</body>
</html>
It looks like you have trouble using Blender. You just miss movements for the bones.
Look in the json :
"animations": [
{ // first object in the array (=animations[0])
"length": 2.36, // animation duration
"hierarchy": [{ // hierarchy : defines the keyframes for each bone
"keys": [{ // hierarchy[0] (first bone) : keys = keyframes
"pos": [0, 1.067, 0], // keys[0] at time 0 : defines pos, rot, scl
"rot": [0, 0, 0, 1],
"scl": [1, 1, 1],
"time": 0
}, { // keys[1] at 2.36 (=last keyframe)
"pos": [0, 1.067, 0],
"rot": [0, 0, 0, 1],
"scl": [1, 1, 1], // ! you can see values are identical to
"time": 2.36 // keys[0] ! so this bone won't move
}],
"parent": -1
}, {
.... // same for all hierarchy...
That means the animation is playing but nothing moves. Try to change any value (pos : [0,1.067,0] to pos:[3,5,20] for example) and you will see that the animation is really playing.
In blender you have to assign the movements to each keyframe.
It is almost complete ;)