samedi 18 avril 2015

Three.js "camera.setLens(data.focalLength)", disables rotating model/geometry interactively

Three.js newby here looking for advice please


My Project loads a 3D obj model, which can be interactively rotated using slider built into the user interface; which works fine. However I need to set the three js camera's field of view according to the focal length of a photo, hence - "data.focalLength". As soon as I include the line in the code: camera.setLens(data.focalLength); all rotational functionality gets disabled. The console returns the line TypeError: model.userData.tweakRot is undefined glMain.js:271:4 as soon as you attempt to rotate the model.


My Git Gist lines 212 - 332 contain the code relating to the above( I would of JSfiddled it, but unfortunately it doesn't really provide any extra insight ).


Perhaps you could please tell me which lines to log in the console so we can diagnose the issue?


three.js perspective camera library (2nd function)


Aucun commentaire:

Enregistrer un commentaire