dispatch contents on n walls regarding Faces_opaques field and Country field
This commit is contained in:
+8
-6
@@ -385,16 +385,18 @@ export default {
|
|||||||
toPos.x += 1.5
|
toPos.x += 1.5
|
||||||
this.controls.lon = 180
|
this.controls.lon = 180
|
||||||
break
|
break
|
||||||
// case 'back':
|
case 'back':
|
||||||
// toPos.z += 4
|
toPos.z += 1.5
|
||||||
// break
|
this.controls.lon = -90
|
||||||
|
break
|
||||||
case 'right':
|
case 'right':
|
||||||
toPos.x -= 1.5
|
toPos.x -= 1.5
|
||||||
this.controls.lon = 0
|
this.controls.lon = 0
|
||||||
break
|
break
|
||||||
// case 'front':
|
case 'front':
|
||||||
// toPos.z -= 4
|
toPos.z -= 1.5
|
||||||
// break
|
this.controls.lon = 90
|
||||||
|
break
|
||||||
}
|
}
|
||||||
// let controls = this.controls
|
// let controls = this.controls
|
||||||
// let rad2deg = this.rad2deg
|
// let rad2deg = this.rad2deg
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ export default {
|
|||||||
projPos: state => state.position,
|
projPos: state => state.position,
|
||||||
projWall: state => state.wall,
|
projWall: state => state.wall,
|
||||||
gridsContentPlaced: state => state.gridsContentPlaced,
|
gridsContentPlaced: state => state.gridsContentPlaced,
|
||||||
contents_size_factor: state => state.contents_size_factor
|
contents_size_factor: state => state.contents_size_factor,
|
||||||
|
faces_opaques: state => state.Faces_opaques
|
||||||
}),
|
}),
|
||||||
color () {
|
color () {
|
||||||
let color = 0x000000
|
let color = 0x000000
|
||||||
@@ -148,6 +149,8 @@ export default {
|
|||||||
this.preview_img_url = `https://api.anarchive-muntadas.figli.io${this.data.Media[0].url}`
|
this.preview_img_url = `https://api.anarchive-muntadas.figli.io${this.data.Media[0].url}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for now display only items that have img to preview
|
||||||
|
// TODO: what to do with items without images ?
|
||||||
if (this.preview_img_url) {
|
if (this.preview_img_url) {
|
||||||
// this.size.x = this.projWall.winW * this.contents_size_factor
|
// this.size.x = this.projWall.winW * this.contents_size_factor
|
||||||
// this.size.y = this.projWall.winH * this.contents_size_factor
|
// this.size.y = this.projWall.winH * this.contents_size_factor
|
||||||
@@ -163,63 +166,58 @@ export default {
|
|||||||
this.size.y = this.projWall.winH * u * this.contents_size_factor
|
this.size.y = this.projWall.winH * u * this.contents_size_factor
|
||||||
// console.log(`windowW :${window.innerWidth}, windowH :${window.innerHeight}, winW : ${this.projWall.winW}, winH : ${this.projWall.winH}, size.x :${this.size.x}, size.y :${this.size.y}`)
|
// console.log(`windowW :${window.innerWidth}, windowH :${window.innerHeight}, winW : ${this.projWall.winW}, winH : ${this.projWall.winH}, size.x :${this.size.x}, size.y :${this.size.y}`)
|
||||||
|
|
||||||
// this.label_canvas = this.createLabelCanvas(this.data.Name.replace(/ /g, '\n').toUpperCase(), 60, 150, txtcolor)
|
if (typeof this.data.country.id !== 'undefined') {
|
||||||
//
|
console.log('this.data.country.id', this.data.country.id)
|
||||||
// this.size.x = this.label_size.x + 0.2
|
switch (parseInt(this.data.country.id)) {
|
||||||
// this.size.y = this.label_size.y + 0.2
|
case 1:
|
||||||
|
this.face = 'left'
|
||||||
// let y = 0
|
break
|
||||||
// let top = this.projPos.y + this.projSize.y / 2
|
case 2:
|
||||||
// let floor = this.projPos.y - this.projSize.y / 2
|
this.face = 'back'
|
||||||
// switch (this.type) {
|
break
|
||||||
// case 'visible':
|
case 3:
|
||||||
// y = top * Math.random()
|
this.face = 'right'
|
||||||
// break
|
break
|
||||||
// case 'context':
|
}
|
||||||
// y = floor / 3 * Math.random()
|
|
||||||
// break
|
|
||||||
// case 'process':
|
|
||||||
// y = floor / 3 + floor / 3 * Math.random()
|
|
||||||
// break
|
|
||||||
// case 'concept':
|
|
||||||
// y = (floor / 3) * 2 + floor / 3 * Math.random()
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// this.position.y = y
|
|
||||||
|
|
||||||
let face = Math.random()
|
|
||||||
// // USES 4 FACES
|
|
||||||
// if (face < 0.25) {
|
|
||||||
// // gauche
|
|
||||||
// this.face = 'left'
|
|
||||||
// this.position.x = this.projPos.x - this.projSize.x / 2 + 0.1
|
|
||||||
// this.position.z = this.projPos.z - this.projSize.z / 2 + this.size.x / 2 + Math.random() * (this.projSize.z - this.size.x / 2)
|
|
||||||
// this.rotation.y = 90
|
|
||||||
// } else if (face >= 0.25 && face < 0.5) {
|
|
||||||
// // fond
|
|
||||||
// this.face = 'back'
|
|
||||||
// this.position.z = this.projPos.z - this.projSize.z / 2 + 0.1
|
|
||||||
// this.position.x = this.projPos.x - this.projSize.x / 2 + this.size.x / 2 + Math.random() * (this.projSize.x - this.size.x / 2)
|
|
||||||
// } else if (face >= 0.5 && face < 0.75) {
|
|
||||||
// // droite
|
|
||||||
// this.face = 'right'
|
|
||||||
// this.position.x = this.projPos.x + this.projSize.x / 2 - 0.1
|
|
||||||
// this.position.z = this.projPos.z - this.projSize.z / 2 + this.size.x / 2 + Math.random() * (this.projSize.z - this.size.x / 2)
|
|
||||||
// this.rotation.y = -90
|
|
||||||
// } else {
|
|
||||||
// // face
|
|
||||||
// this.face = 'front'
|
|
||||||
// this.position.z = this.projPos.z + this.projSize.z / 2 - 0.1
|
|
||||||
// this.position.x = this.projPos.x - this.projSize.x / 2 + this.size.x / 2 + Math.random() * (this.projSize.x - this.size.x / 2)
|
|
||||||
// this.rotation.y = 180
|
|
||||||
// }
|
|
||||||
|
|
||||||
// RANDOMLY USE 2 FACES
|
|
||||||
if (face < 0.5) {
|
|
||||||
this.face = 'left'
|
|
||||||
} else {
|
} else {
|
||||||
this.face = 'right'
|
let face = Math.random()
|
||||||
|
switch (this.faces_opaques) {
|
||||||
|
case 1:
|
||||||
|
this.face = 'back'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
// RANDOMLY USE 2 FACES
|
||||||
|
if (face < 0.5) {
|
||||||
|
this.face = 'left'
|
||||||
|
} else {
|
||||||
|
this.face = 'right'
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
// RANDOMLY USE 3 FACES
|
||||||
|
if (face < 0.33) {
|
||||||
|
this.face = 'left'
|
||||||
|
} else if (face >= 0.33 && face < 0.66) {
|
||||||
|
this.face = 'back'
|
||||||
|
} else {
|
||||||
|
this.face = 'right'
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 4:
|
||||||
|
// RANDOMLY USE 4 FACES
|
||||||
|
if (face < 0.25) {
|
||||||
|
this.face = 'left'
|
||||||
|
} else if (face >= 0.25 && face < 0.5) {
|
||||||
|
this.face = 'back'
|
||||||
|
} else if (face >= 0.5 && face < 0.75) {
|
||||||
|
this.face = 'right'
|
||||||
|
} else {
|
||||||
|
this.face = 'front'
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
console.log('face', this.face)
|
||||||
// define side
|
// define side
|
||||||
let side
|
let side
|
||||||
switch (this.face) {
|
switch (this.face) {
|
||||||
@@ -248,7 +246,7 @@ export default {
|
|||||||
this.position.x = this.projPos.x - this.projSize.x / 2 + gridPos.x
|
this.position.x = this.projPos.x - this.projSize.x / 2 + gridPos.x
|
||||||
this.position.y = this.projPos.y - this.projSize.y / 2 + gridPos.y
|
this.position.y = this.projPos.y - this.projSize.y / 2 + gridPos.y
|
||||||
switch (this.face) {
|
switch (this.face) {
|
||||||
case 'face':
|
case 'front':
|
||||||
this.position.z = this.projPos.z + this.projSize.z / 2 - 0.1
|
this.position.z = this.projPos.z + this.projSize.z / 2 - 0.1
|
||||||
this.rotation.y = 180
|
this.rotation.y = 180
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -443,6 +443,10 @@ export default {
|
|||||||
Vimeo
|
Vimeo
|
||||||
Url
|
Url
|
||||||
categories
|
categories
|
||||||
|
country{
|
||||||
|
id
|
||||||
|
Name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
contexts(where: { Published: "true" }){
|
contexts(where: { Published: "true" }){
|
||||||
id
|
id
|
||||||
@@ -454,6 +458,10 @@ export default {
|
|||||||
Text2
|
Text2
|
||||||
Vimeo
|
Vimeo
|
||||||
Url
|
Url
|
||||||
|
country{
|
||||||
|
id
|
||||||
|
Name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processes(where: { Published: "true" }){
|
processes(where: { Published: "true" }){
|
||||||
id
|
id
|
||||||
@@ -465,6 +473,10 @@ export default {
|
|||||||
Text2
|
Text2
|
||||||
Vimeo
|
Vimeo
|
||||||
Url
|
Url
|
||||||
|
country{
|
||||||
|
id
|
||||||
|
Name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
concepts(where: { Published: "true" }){
|
concepts(where: { Published: "true" }){
|
||||||
id
|
id
|
||||||
|
|||||||
Reference in New Issue
Block a user