projects size random, better light

This commit is contained in:
2020-08-29 15:12:26 +02:00
parent 654fd08863
commit 2a268a33b6
4 changed files with 42 additions and 35 deletions
+15 -4
View File
@@ -1,14 +1,15 @@
<template>
<div id="root">
<!-- <header role="banner">
<header role="banner">
<div class="wrapper">
<h1
class="site-title"
tabindex="0"
>
Muntadas
</h1>
</div>
</header> -->
</header>
<section role="main-content">
<div class="wrapper">
<renderer :obj="myRenderer" :size="size">
@@ -21,8 +22,8 @@
</orbit-controls> -->
<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="2" :position="{x:100,y:-150,z:-50}" :options="light_opts" />
<!-- <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" /> -->
<animation :fn="animate" :speed="3" />
@@ -127,6 +128,16 @@ export default {
ground.rotateZ(this.deg2rad(180))
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 {
debug: _debug,
myRenderer: renderer,