From cecebc9ae499ea6f3136620e6d45c683b7c0792e Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 11 Mar 2016 22:01:01 -0800 Subject: [PATCH 1/3] add example --- examples/data_visualization/photo_sphere.js | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 examples/data_visualization/photo_sphere.js diff --git a/examples/data_visualization/photo_sphere.js b/examples/data_visualization/photo_sphere.js new file mode 100644 index 0000000000..8ea599d4f9 --- /dev/null +++ b/examples/data_visualization/photo_sphere.js @@ -0,0 +1,60 @@ +// photo_sphere.js +// +// Created by James B. Pollack on 3/11/2015 +// Copyright 2016 High Fidelity, Inc. +// +// This script creates a photo sphere around you. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var photoSphere, light;; + +//equirectangular +var url = 'http://hifi-content.s3.amazonaws.com/james/projection_objects/IMG_9167.JPG'; + +var MODEL_URL = 'http://hifi-content.s3.amazonaws.com/james/projection_objects/photosphere2.fbx'; + +function createPhotoSphere() { + + var textureString = 'photo:"' + url + '"' + print('ADDING TEXTURE:: ' + textureString); + var properties = { + type: 'Model', + modelURL: MODEL_URL, + name: 'hifi-photo-sphere', + dimensions: { + x: 32, + y: 32, + z: 32 + }, + position: MyAvatar.position, + textures: textureString + } + photoSphere = Entities.addEntity(properties); +} + +function createLight() { + var properties = { + name: 'hifi-photo-sphere-light', + type: 'Light', + dimensions: { + x: 36, + y: 36, + z: 36, + }, + intensity: 4.0, + falloffRadius: 22, + position: MyAvatar.position + } + light = Entities.addEntity(properties); +} + +function cleanup() { + Entities.deleteEntity(photoSphere); + Entities.deleteEntity(light); +} + +Script.scriptEnding.connect(cleanup); +createPhotoSphere(); +createLight(); \ No newline at end of file From b0109133c0af3f95370177192ba1c25fa87f7ff5 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 11 Mar 2016 22:02:49 -0800 Subject: [PATCH 2/3] add git handle --- examples/data_visualization/photo_sphere.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/data_visualization/photo_sphere.js b/examples/data_visualization/photo_sphere.js index 8ea599d4f9..d8be423bd7 100644 --- a/examples/data_visualization/photo_sphere.js +++ b/examples/data_visualization/photo_sphere.js @@ -1,6 +1,6 @@ // photo_sphere.js // -// Created by James B. Pollack on 3/11/2015 +// Created by James B. Pollack @imgntn on 3/11/2015 // Copyright 2016 High Fidelity, Inc. // // This script creates a photo sphere around you. @@ -18,7 +18,7 @@ var MODEL_URL = 'http://hifi-content.s3.amazonaws.com/james/projection_objects/p function createPhotoSphere() { var textureString = 'photo:"' + url + '"' - print('ADDING TEXTURE:: ' + textureString); + var properties = { type: 'Model', modelURL: MODEL_URL, From 96bc17cd5ee84dda5f2a9c7280b2c8befcada4cd Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Sat, 12 Mar 2016 16:01:10 -0800 Subject: [PATCH 3/3] Update photo_sphere.js --- examples/data_visualization/photo_sphere.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/data_visualization/photo_sphere.js b/examples/data_visualization/photo_sphere.js index d8be423bd7..c62fb7d122 100644 --- a/examples/data_visualization/photo_sphere.js +++ b/examples/data_visualization/photo_sphere.js @@ -8,7 +8,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var photoSphere, light;; +var photoSphere, light; //equirectangular var url = 'http://hifi-content.s3.amazonaws.com/james/projection_objects/IMG_9167.JPG'; @@ -57,4 +57,4 @@ function cleanup() { Script.scriptEnding.connect(cleanup); createPhotoSphere(); -createLight(); \ No newline at end of file +createLight();