projects size random, better light
This commit is contained in:
+10
-1
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
body{
|
body{
|
||||||
color: #ff00ff;
|
color: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root{
|
#root{
|
||||||
@@ -20,6 +20,15 @@ body{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header[role="banner"]{
|
||||||
|
padding:1em;
|
||||||
|
pointer-events: none;
|
||||||
|
h1{
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
section[role="main-content"]{
|
section[role="main-content"]{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,22 +15,10 @@ body{
|
|||||||
}
|
}
|
||||||
|
|
||||||
#root{
|
#root{
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100vw;
|
|
||||||
height:100vh;
|
|
||||||
%layout-element{
|
|
||||||
width:100vw;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
header[role="banner"]{
|
header[role="banner"]{
|
||||||
flex: 0 0 auto;
|
position: absolute;
|
||||||
@extend %layout-element;
|
|
||||||
padding:1em $side-padding 0 $side-padding;
|
|
||||||
}
|
}
|
||||||
section[role="main-content"]{
|
section[role="main-content"]{
|
||||||
flex:1 1 auto;
|
|
||||||
@extend %layout-element;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
>.wrapper{
|
>.wrapper{
|
||||||
// padding:0 $side-padding 0 $side-padding;
|
// padding:0 $side-padding 0 $side-padding;
|
||||||
@@ -40,11 +28,6 @@ body{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
footer[role="tools"]{
|
footer[role="tools"]{
|
||||||
flex:0 0 auto;
|
position: absolute;
|
||||||
@extend %layout-element;
|
|
||||||
// padding-bottom: 1em;
|
|
||||||
// >*{
|
|
||||||
// padding:0.5em 1em;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-4
@@ -1,14 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="root">
|
<div id="root">
|
||||||
<!-- <header role="banner">
|
<header role="banner">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<h1
|
<h1
|
||||||
class="site-title"
|
class="site-title"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
|
Muntadas
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</header> -->
|
</header>
|
||||||
<section role="main-content">
|
<section role="main-content">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<renderer :obj="myRenderer" :size="size">
|
<renderer :obj="myRenderer" :size="size">
|
||||||
@@ -21,8 +22,8 @@
|
|||||||
</orbit-controls> -->
|
</orbit-controls> -->
|
||||||
<camera ref="camera" :position="init_cam_pos" :rotation="{x:0, y:0, z:0}" />
|
<camera ref="camera" :position="init_cam_pos" :rotation="{x:0, y:0, z:0}" />
|
||||||
|
|
||||||
<light :hex="0xffffff" :intensity="5" :position="{x:-100,y:150,z:50}" />
|
<!-- <light :hex="0xffffff" :intensity="5" :position="{x:-100,y:150,z:50}" />
|
||||||
<light :hex="0xffffff" :intensity="2" :position="{x:100,y:-150,z:-50}" :options="light_opts" />
|
<light :hex="0xffffff" :intensity="2" :position="{x:100,y:-150,z:-50}" :options="light_opts" /> -->
|
||||||
|
|
||||||
<animation :fn="animate" :speed="3" />
|
<animation :fn="animate" :speed="3" />
|
||||||
|
|
||||||
@@ -127,6 +128,16 @@ export default {
|
|||||||
ground.rotateZ(this.deg2rad(180))
|
ground.rotateZ(this.deg2rad(180))
|
||||||
scene.add(ground)
|
scene.add(ground)
|
||||||
|
|
||||||
|
// lights
|
||||||
|
var sun = new THREE.PointLight(0xffffff, 5)
|
||||||
|
var sunGeo = new THREE.SphereBufferGeometry(1, 16, 8)
|
||||||
|
var sunMat = new THREE.MeshBasicMaterial({ color: 0xffffff })
|
||||||
|
sun.add(new THREE.Mesh(sunGeo, sunMat))
|
||||||
|
sun.position.set(-150, 150, 50)
|
||||||
|
sun.castShadows = true
|
||||||
|
// sun.target.position.set(0, 0, 0)
|
||||||
|
scene.add(sun)
|
||||||
|
// scene.add(sun.target)
|
||||||
return {
|
return {
|
||||||
debug: _debug,
|
debug: _debug,
|
||||||
myRenderer: renderer,
|
myRenderer: renderer,
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ export default {
|
|||||||
// },
|
// },
|
||||||
block3d: null,
|
block3d: null,
|
||||||
block_opts: {
|
block_opts: {
|
||||||
side: THREE.DoubleSide,
|
side: THREE.DoubleSide
|
||||||
wireframe: false
|
// wireframe: true,
|
||||||
// transparent: true,
|
// transparent: true,
|
||||||
// opacity: 0.6
|
// opacity: 0.6
|
||||||
// renderOrder: 0
|
// renderOrder: 0
|
||||||
@@ -76,26 +76,30 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
// console.log('this.index', this.index)
|
// console.log('this.index', this.index)
|
||||||
// this.position = { x: 5, y: 5, z: 0 }
|
// randomize size and positions
|
||||||
this.size.y = 30 + Math.random() * 90
|
this.size.y = 100 + Math.random() * 90
|
||||||
this.position.y = -10 + Math.random() * this.size.y / 2
|
this.size.z = 10 + Math.random() * 30
|
||||||
// this.label_position.y = this.position.y + this.size.y / 2 - 5
|
|
||||||
this.label_position.y = 5
|
|
||||||
this.position.x = this.label_position.x = (-this.len + 1) / 2 * (this.size.x + 5) + (this.size.x + 5) * this.index
|
this.position.x = this.label_position.x = (-this.len + 1) / 2 * (this.size.x + 5) + (this.size.x + 5) * this.index
|
||||||
this.label_position.z = this.size.z / 2 + 0.1
|
this.position.y = -1 * this.size.y / 2 + 10 + Math.random() * 30// -10 + Math.random() * this.size.y / 2
|
||||||
|
this.position.z = -10 + Math.random() * 10
|
||||||
|
this.label_position.y = 5
|
||||||
|
this.label_position.z = this.position.z + this.size.z / 2 + 0.1
|
||||||
this.label_canvas = this.createLabelCanvas()
|
this.label_canvas = this.createLabelCanvas()
|
||||||
// console.log('this.label_canvas', this.label_canvas)
|
// console.log('this.label_canvas', this.label_canvas)
|
||||||
},
|
// mesh options
|
||||||
mounted () {
|
|
||||||
// console.log('project mounted', this)
|
|
||||||
this.block3d = this.$refs.block3d.curObj
|
this.block3d = this.$refs.block3d.curObj
|
||||||
this.block3d.castShadow = true
|
this.block3d.castShadow = true
|
||||||
this.block3d.receiveShadow = true
|
this.block3d.receiveShadow = true
|
||||||
|
// record self references
|
||||||
this.block3d.userData = {
|
this.block3d.userData = {
|
||||||
vnode: this
|
vnode: this
|
||||||
}
|
}
|
||||||
this.label3d = this.$refs.label3d.curObj
|
this.label3d = this.$refs.label3d.curObj
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
// console.log('project mounted', this)
|
||||||
|
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createLabelCanvas () {
|
createLabelCanvas () {
|
||||||
// console.log('createLabelCanvas', this.data.Titre)
|
// console.log('createLabelCanvas', this.data.Titre)
|
||||||
|
|||||||
Reference in New Issue
Block a user