Skip to content

Commit 69702b7

Browse files
committed
add back the 3d gallery
1 parent 3b79726 commit 69702b7

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

src/components/Examples.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
room : Room
2020
},
2121
mounted() {
22-
this.$store.commit('setInitialCameraPose', [6, 2.5, 4]);
22+
this.$store.commit('setInitialCameraPose', [14, 2.5, 4]);
2323
if(this.embed && this.embed === 'true') {
2424
this.$store.commit('setEmbedded', true);
2525
}
@@ -32,7 +32,7 @@ export default {
3232
temp.reverse();
3333
this.sculptures = temp; //array.push isn't tracked by state, resetting is
3434
setTimeout(() => {
35-
window.onCanvasResize();
35+
window.onCanvasResize();
3636
}, 10);
3737
3838
}

src/components/Home3D.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Room from './Room.vue';
88
import {handelUnsavedChanges} from '../helpers/handelUnsavedChanges.js';
99
1010
export default {
11+
props: ['embed'],
1112
data: function() {
1213
return {
1314
sculptures: [],
@@ -19,15 +20,23 @@ export default {
1920
room : Room
2021
},
2122
mounted() {
22-
this.$store.commit('setInitialCameraPose', [6, 2.5, 4]);
23+
this.$store.commit('sculpturesLoaded', true);
24+
this.$store.commit('setInitialCameraPose', [16, 2.5, 4]);
25+
if(this.embed && this.embed === 'true') {
26+
this.$store.commit('setEmbedded', true);
27+
}
2328
this.$store.dispatch('fetchAllSculptures').then(sculptures => {
2429
if(sculptures) {
2530
let temp = [];
2631
Object.keys(sculptures).forEach(key => {
2732
temp.push(sculptures[key]);
2833
})
2934
temp.reverse();
30-
this.sculptures = temp; //array.push isn't tracked by state, resetting is
35+
this.sculptures = temp.slice(0, 256); //array.push isn't tracked by state, resetting is
36+
setTimeout(() => {
37+
this.$store.commit('sculpturesLoaded', true);
38+
window.onCanvasResize();
39+
}, 10);
3140
}
3241
this.$store.commit('joinRoom', this.roomName);
3342
})

src/components/Room.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {Vector3} from 'three';
1414
export default {
1515
props: ['sculpturesData'],
1616
data: function() {
17-
return {
18-
grid : {x: 5, z: 0, spacing: 3.0, size: 1.0},
17+
return {
18+
grid : {x: 16, z: 0, spacing: 4.0, size: 1.0},
1919
sculptures : this.sculpturesData || [],
2020
sculpPositions: []
2121
}

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const hemisphereLight = new HemisphereLight(0xFFFFFF, 0xFFFFFF);
201201
const startTime = Date.now();
202202
let prevCanvasSize = window.innerWidth/2;
203203
let tweeningSculpturesOpacity = false;
204-
let fogDistance = 8.0;
204+
let fogDistance = 200.0;
205205
window.fogDistance = fogDistance;
206206

207207
let loader = new TextureLoader();
@@ -516,7 +516,7 @@ function onMouseUp(event) {
516516
if (store.state.intersectedObject && store.state.intersectedObject === tempIntersectedObject) {
517517
mouseDownTime = Date.now() - mouseDownTime;
518518
if(mouseDownTime < 400) {
519-
if(router.currentRoute.name === 'examples') {
519+
if(router.currentRoute.name === 'examples' || router.currentRoute.name === 'gallery' ) {
520520
store.state.selectedObject = store.state.intersectedObject;
521521
selectedSculptureOpacity.opacity = 1.0;
522522
canvas.style.cursor = 'auto';

src/router/routes.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ export const routes = [
3232
title: 'Examples',
3333
}
3434
},
35+
{
36+
path: '/gallery',
37+
name: 'gallery',
38+
component: () => import(/* webpackChunkName: "examples" */ '../components/Home3D.vue'),
39+
props: (route) => ({embed: route.query.embed}),
40+
meta: {
41+
title: 'Gallery',
42+
}
43+
},
3544
{
3645
path: '/new/:type',
3746
name: 'new',

0 commit comments

Comments
 (0)