Sunday 15 April 2012

javascript - Three js Trackball controls - manual rotation -



javascript - Three js Trackball controls - manual rotation -

i'm having problems trackballcontrols in three.js. i'd rotate , position photographic camera manually. here's test function.

function rotatetest(){ console.log(camera.rotation) // three.euler {_x: 0, _y: 0.7853981462831776, _z: 0, _order: "xyz", onchangecallback: function…} camera.rotatez(1); console.log(camera.rotation) // three.euler {_x: 7.850462316470535e-17, _y: 0.7853981462831774, _z: 1, _order: "xyz", onchangecallback: function…} }

the objects rotation appears altered no alter seen. please help me out.

thanks,

you can first create cube , focus @ it.

when move cube , photographic camera can rotated

cube = new three.mesh(new three.boxgeometry(10,10,10), new three.meshphongmaterial({color: 0x123876})); camera.lookat(cube); //rotate: utilize cube.position.x++; //camera: utilize camera.position.x++;

and trackball can still used. if want photographic camera tilt effect, watch threejs example.

http://threejs.org/examples/#webgl_particles_billboards

javascript three.js

No comments:

Post a Comment