three.js - focus camera on THREE.Geometry vertices -


  1. i want focus camera on three.geometry, 1 vertex @ time ,
  2. transition camera next vertex of same geometry

how should accomplish 1 & 2?

i created fiddle.

http://jsfiddle.net/5oajajpd/

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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -