I am trying to load ply file. The issue is that I cannot determine the camera location properly. In order to do that I think I need to specify based on the point cloud information. Here is the code.
// Setup scene
scene = new THREE.Scene();
// Setup camera
camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, .01, 100);
// camera.position.set(0, 0.3, 15);
// Setup light
var light = new THREE.PointLight();
light.position.set(0, 2.5, 0);
scene.add(light);
//Setup renderer
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// Load the 3D enviorment model
var modelLoader = new THREE.PLYLoader();
modelLoader.load('./odm_georeferenced_model.ply', function(obj) {
coupleModel = new THREE.Points(obj, new THREE.MeshBasicMaterial({ vertexColors: THREE.VertexColors }));
controls.update();
scene.add(coupleModel);
animate();
});
window.addEventListener('resize', onWindowResize, false);