three.js - focus camera on THREE.Geometry vertices -
- i want focus camera on three.geometry, 1 vertex @ time ,
- transition camera next vertex of same geometry
how should accomplish 1 & 2?
i created fiddle.
the function move camera goes through each vertex , sets camera position. transition animation can set x,y, , z properties through jquery animate function, or animation lib of choice.
the move camera function triggered interval. in sphere example spiral around , around sphere forever.
var = 0; function movecamera() { var point = mesh.geometry.vertices[i]; var coeff = 1 + altitude / rad; camera.position.x = point.x * coeff; camera.position.y = point.y * coeff; camera.position.z = point.z * coeff; camera.lookat(mesh.position); i++; if (i > mesh.geometry.vertices.length) { = 0; } }
Comments
Post a Comment