rotation - rotating camera three.js -
rotation - rotating camera three.js -
i trying when click on button move photographic camera around object. dont want move object(it need centered).
i having:
and js functions
function moveup() { camera.position.y -=50; } function movedown() { camera.position.y +=50; }
but moving object down/up when click on button. there posibility move photographic camera arround , how? objects cubes.. example:
var geometry = new three.cubegeometry( 50, 50, 50 ); var material = new three.meshfacematerial( [ new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'beton.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'beton.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'beton.jpg' ) } ) ] ); cube = new three.mesh( geometry, material ); cube.position.z = 450; scene.add(cube);
you changing photographic camera position, while keeping it's orientation. guess want reorientate photographic camera point cube (in effect, centering it). after move camera, seek camera.lookat(cube.position);
needs lastly thing in moveup , movedown
camera rotation three.js
Comments
Post a Comment