polofgrs / Computer-Vision-Emergency-Response-Toolkit

Other
0 stars 1 forks source link

[Improvement] Category 2 algorithms #4

Closed polofgrs closed 4 years ago

polofgrs commented 5 years ago

Set up category 2 algorithms. Using:

polofgrs commented 5 years ago

Exif data can be accessed through Jimp._exif

polofgrs commented 5 years ago

finally used external npm libraries: Check 495c7cb :smile:

polofgrs commented 5 years ago

Three.js ? :thinking:

polofgrs commented 5 years ago

https://threejs.org/examples/#webgl_skinning_simple:

// INIT
var container = document.createElement( 'div' );
document.body.appendChild( container );

// CAMERA (replace FOV and position)
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( 24, 8, 24 );

// SCENE
scene = new THREE.Scene();
scene.background = new THREE.Color( 0xa0a0a0 );
scene.fog = new THREE.Fog( 0xa0a0a0, 70, 100 );

// GROUND
var geometry = new THREE.PlaneBufferGeometry( 500, 500 );
var material = new THREE.MeshPhongMaterial( { color: 0x999999, depthWrite: false } );
var ground = new THREE.Mesh( geometry, material );
ground.position.set( 0, - 5, 0 );
ground.rotation.x = - Math.PI / 2;
ground.receiveShadow = true;
scene.add( ground );

// GRID
var grid = new THREE.GridHelper( 500, 100, 0x000000, 0x000000 );
grid.position.y = - 5;
grid.material.opacity = 0.2;
grid.material.transparent = true;
scene.add( grid );

Something like that... (+ lighting ? :thinking: )... Also, maybe the ground is not necessary, but the grid is...

Do not forget the resize / redraw (necessary ? :thinking: )

polofgrs commented 5 years ago

https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_terrain_raycast.html

function onMouseMove( event ) {
    mouse.x = ( event.clientX / renderer.domElement.clientWidth ) * 2 - 1;
    mouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1;
    raycaster.setFromCamera( mouse, camera );
    // See if the ray from the camera into the world hits one of our meshes
    var intersects = raycaster.intersectObject( mesh );
    // Toggle rotation bool for meshes that we clicked
    if ( intersects.length > 0 ) {
        helper.position.set( 0, 0, 0 );
        helper.lookAt( intersects[ 0 ].face.normal );
        helper.position.copy( intersects[ 0 ].point );
    }
}

in init() :

container.addEventListener( 'mousemove', onMouseMove, false );