Skip to content

Commit

Permalink
remove one light
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyangXYZ committed Jan 2, 2024
1 parent e6a41f4 commit dbc634e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 859 deletions.
Binary file added public/models/sensor/scene.glb
Binary file not shown.
834 changes: 0 additions & 834 deletions public/models/sensor/scene.gltf

This file was deleted.

15 changes: 13 additions & 2 deletions src/components/TopoEditToolbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const nodeTypes = [
}
]
const presetTopos:any = []
const addNode = () => {
Network.AddNode(nodeType.value)
SignalUpdateTopology.value++
Expand All @@ -42,7 +44,16 @@ const finishEdit = () => {
<template>
<el-card class="card">
<el-row :gutter="30">
<el-col>Load preset topology:</el-col>
<el-col
>Load preset topology:<el-select size="20px">
<el-option
class="item"
v-for="item in presetTopos"
:key="item.value"
:label="item.label"
:value="item.value"
/> </el-select
></el-col>
</el-row>
<el-row :gutter="30">
<el-col>
Expand Down Expand Up @@ -78,7 +89,7 @@ const finishEdit = () => {
<style scoped>
.card {
/* margin-top: 2px; */
height: 120px;
height: 150px;
/* background-color:white; */
/* width: 380px; */
font-size: 0.87rem;
Expand Down
24 changes: 1 addition & 23 deletions src/hooks/useDrawTopology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,6 @@ export function useDrawTopology(dom: HTMLElement) {
spotLight.shadow.mapSize.height = 4096
spotLight.castShadow = true
scene.add(spotLight)

const dirLight = new THREE.DirectionalLight(0xffffff, 0.1)
dirLight.color.setHSL(0.1, 1, 0.95)
dirLight.position.set(-1, 1.75, 1)
dirLight.position.multiplyScalar(30)
scene.add(dirLight)

dirLight.castShadow = true

dirLight.shadow.mapSize.width = 2048
dirLight.shadow.mapSize.height = 2048

const d = 50

dirLight.shadow.camera.left = -d
dirLight.shadow.camera.right = d
dirLight.shadow.camera.top = d
dirLight.shadow.camera.bottom = -d

dirLight.shadow.camera.far = 3500
dirLight.shadow.bias = -0.0001
}

const drawGround = () => {
Expand Down Expand Up @@ -154,7 +133,6 @@ export function useDrawTopology(dom: HTMLElement) {
object.castShadow = true
object.receiveShadow = true
object.material.color = new THREE.Color('#999')
object.material.side = THREE.DoubleSide
}
})
modelTemplates[type] = modelTemplate
Expand All @@ -177,7 +155,7 @@ export function useDrawTopology(dom: HTMLElement) {
)
await loadModel(
NODE_TYPE.END_SYSTEM_SENSOR,
'/models/sensor/scene.gltf',
'/models/sensor/scene.glb',
[2, 2, 2],
-Math.PI / 3
)
Expand Down

0 comments on commit dbc634e

Please sign in to comment.