building an interactive panorama video experience, where users can navigate
+ Using videos, not just images.
++ We must deal with tablets as well!
prototype before the shooting
shot with POSSIBLE London
test the raw videos on the spot
6 separated wide
angled cameras
WebGL - using three.js library
Create a sphere -> add video as a texture
video = document.createElement('video');
video.src = 'testvideo.mp4';
videoTexture = new THREE.Texture(video);
geometry = new THREE.SphereGeometry(500,60,40);
material = new THREE.MeshBasicMateial({
map = videoTexture
});
videoMesh = new THREE.Mesh(geometry, material);
scene.add(videoMesh).
function render() {
...
videoTexture.needsUpdate = true;
...
}
using ondeviceorientation!
window.ondeviceorientation = function (event) {
var alpha = (event.alpha),
beta = (event.beta),
gamma = (event.gamma);
if (window.orientation == 0) {
lon = gamma;
lat = beta - 90;
} else if (window.orientation == 90) {
lon = -alpha;
lat = -gamma - 90;
} else if (window.orientation == -90) {
lon = -alpha;
lat = gamma - 90;
}
}
Get Orientation Datas:
function render() {
lat = Math.max(-85, Math.min(85, lat));
phi = THREE.Math.degToRad(90 - lat);
theta = THREE.Math.degToRad(lon);
camera.target.x = 500 * Math.sin(phi) * Math.cos(theta);
camera.target.y = 500 * Math.cos(phi);
camera.target.z = 500 * Math.sin(phi) * Math.sin(theta);
camera.lookAt(camera.target);
videoTexture.needsUpdate = true;
renderer.render(scene, camera);
}
Add some code to the render...
(in nutshells)
3d sound in WebGL
AudioPannerNode
define position / orientation / velocity of the sound.
jozsef.szabadszallasi@possible.com