directional light position
This commit is contained in:
parent
a6c48989d0
commit
c4979b5890
6
app.js
6
app.js
@ -8,8 +8,6 @@ import { TetraControls } from './jsm/TetraControls.js'
|
|||||||
import { Vortex } from './jsm/Vortex.js'
|
import { Vortex } from './jsm/Vortex.js'
|
||||||
|
|
||||||
|
|
||||||
Array.prototype.pick = function () { return this.splice(Math.floor(Math.random() * this.length), 1)[0] }
|
|
||||||
|
|
||||||
HTMLElement.prototype.addNewChild = function (tag, properties) {
|
HTMLElement.prototype.addNewChild = function (tag, properties) {
|
||||||
let child = document.createElement(tag)
|
let child = document.createElement(tag)
|
||||||
for (let key in properties) {
|
for (let key in properties) {
|
||||||
@ -58,8 +56,8 @@ scene.camera.position.set(5, 0, 16)
|
|||||||
scene.ambientLight = new THREE.AmbientLight(0xffffff, 0.2)
|
scene.ambientLight = new THREE.AmbientLight(0xffffff, 0.2)
|
||||||
scene.add(scene.ambientLight)
|
scene.add(scene.ambientLight)
|
||||||
|
|
||||||
scene.directionalLight = new THREE.DirectionalLight(0xffffff, 20)
|
scene.directionalLight = new THREE.DirectionalLight(0xffffff, 15)
|
||||||
scene.directionalLight.position.set(5, -100, -16)
|
scene.directionalLight.position.set(5, 0, -10)
|
||||||
scene.add(scene.directionalLight)
|
scene.add(scene.directionalLight)
|
||||||
|
|
||||||
const holdQueue = new HoldQueue()
|
const holdQueue = new HoldQueue()
|
||||||
|
@ -66,19 +66,24 @@ class TetraGUI extends GUI {
|
|||||||
|
|
||||||
if (window.location.search.includes("debug")) {
|
if (window.location.search.includes("debug")) {
|
||||||
this.debug = this.addFolder("debug")
|
this.debug = this.addFolder("debug")
|
||||||
let cameraPositionFolder = this.debug.addFolder("camera.position")
|
let cameraPosition = this.debug.addFolder("camera.position")
|
||||||
cameraPositionFolder.add(scene.camera.position, "x")
|
cameraPosition.add(scene.camera.position, "x")
|
||||||
cameraPositionFolder.add(scene.camera.position, "y")
|
cameraPosition.add(scene.camera.position, "y")
|
||||||
cameraPositionFolder.add(scene.camera.position, "z")
|
cameraPosition.add(scene.camera.position, "z")
|
||||||
|
|
||||||
|
let directionalLightPosition = this.debug.addFolder("directionalLight.position")
|
||||||
|
directionalLightPosition.add(scene.directionalLight.position, "x")
|
||||||
|
directionalLightPosition.add(scene.directionalLight.position, "y")
|
||||||
|
directionalLightPosition.add(scene.directionalLight.position, "z")
|
||||||
|
|
||||||
let lightFolder = this.debug.addFolder("lights intensity")
|
let light = this.debug.addFolder("lights intensity")
|
||||||
lightFolder.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20)
|
light.add(scene.ambientLight, "intensity").name("ambient").min(0).max(20)
|
||||||
lightFolder.add(scene.directionalLight, "intensity").name("directional").min(0).max(20)
|
light.add(scene.directionalLight, "intensity").name("directional").min(0).max(20)
|
||||||
|
|
||||||
let materialsFolder = this.debug.addFolder("materials opacity")
|
let materials = this.debug.addFolder("materials opacity")
|
||||||
materialsFolder.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1)
|
materials.add(scene.vortex.darkCylinder.material, "opacity").name("dark").min(0).max(1)
|
||||||
materialsFolder.add(scene.vortex.colorFullCylinder.material, "opacity").name("colorFull").min(0).max(1)
|
materials.add(scene.vortex.colorFullCylinder.material, "opacity").name("colorFull").min(0).max(1)
|
||||||
materialsFolder.add(I.prototype.material, "reflectivity").min(0).max(2).onChange(() => {
|
materials.add(I.prototype.material, "reflectivity").min(0).max(2).onChange(() => {
|
||||||
J.prototype.material.reflectivity = I.prototype.material.reflectivity
|
J.prototype.material.reflectivity = I.prototype.material.reflectivity
|
||||||
L.prototype.material.reflectivity = I.prototype.material.reflectivity
|
L.prototype.material.reflectivity = I.prototype.material.reflectivity
|
||||||
O.prototype.material.reflectivity = I.prototype.material.reflectivity
|
O.prototype.material.reflectivity = I.prototype.material.reflectivity
|
||||||
|
@ -2,6 +2,8 @@ import * as THREE from 'three'
|
|||||||
import { scheduler } from './scheduler.js'
|
import { scheduler } from './scheduler.js'
|
||||||
|
|
||||||
|
|
||||||
|
Array.prototype.pick = function () { return this.splice(Math.floor(Math.random() * this.length), 1)[0] }
|
||||||
|
|
||||||
let P = (x, y, z = 0) => new THREE.Vector3(x, y, z)
|
let P = (x, y, z = 0) => new THREE.Vector3(x, y, z)
|
||||||
|
|
||||||
const GRAVITY = -20
|
const GRAVITY = -20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user