Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
DSMS
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
詹银鑫
DSMS
Commits
92f74167
提交
92f74167
authored
4月 21, 2025
作者:
詹银鑫
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
3d模型加载
上级
0d7dba15
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
36 行增加
和
1 行删除
+36
-1
assets.js
src/views/gdMap/assets.js
+6
-1
map.js
src/views/gdMap/map.js
+30
-0
没有找到文件。
src/views/gdMap/assets.js
浏览文件 @
92f74167
...
@@ -45,7 +45,6 @@ export class Assets {
...
@@ -45,7 +45,6 @@ export class Assets {
name
:
"china"
,
name
:
"china"
,
path
:
base_url
+
"assets/json/中华人民共和国.json"
,
path
:
base_url
+
"assets/json/中华人民共和国.json"
,
},
},
{
{
type
:
"File"
,
type
:
"File"
,
name
:
"mapJson"
,
name
:
"mapJson"
,
...
@@ -60,6 +59,12 @@ export class Assets {
...
@@ -60,6 +59,12 @@ export class Assets {
// path: base_url + "assets/json/zger.json",
// path: base_url + "assets/json/zger.json",
path
:
base_url
+
"assets/json/jiedao.json"
,
path
:
base_url
+
"assets/json/jiedao.json"
,
},
},
{
type
:
"File"
,
name
:
"mapTerrain"
,
path
:
base_url
+
"assets/json/Scene_cq15_200.gltf"
,
// path: base_url + "assets/json/Scene.gltf",
},
{
type
:
"Texture"
,
name
:
"huiguang"
,
path
:
huiguang
},
{
type
:
"Texture"
,
name
:
"huiguang"
,
path
:
huiguang
},
{
type
:
"Texture"
,
name
:
"rotationBorder1"
,
path
:
rotationBorder1
},
{
type
:
"Texture"
,
name
:
"rotationBorder1"
,
path
:
rotationBorder1
},
...
...
src/views/gdMap/map.js
浏览文件 @
92f74167
...
@@ -52,6 +52,10 @@ import infoData from "./map/infoData"
...
@@ -52,6 +52,10 @@ import infoData from "./map/infoData"
import
gsap
from
"gsap"
import
gsap
from
"gsap"
import
emitter
from
"@/utils/emitter"
import
emitter
from
"@/utils/emitter"
import
{
InteractionManager
}
from
"three.interactive"
import
{
InteractionManager
}
from
"three.interactive"
// 引入模型加载模块
import
{
Resource
}
from
"@/mini3d/utils/Resource"
function
sortByValue
(
data
)
{
function
sortByValue
(
data
)
{
data
.
sort
((
a
,
b
)
=>
b
.
value
-
a
.
value
)
data
.
sort
((
a
,
b
)
=>
b
.
value
-
a
.
value
)
return
data
return
data
...
@@ -100,6 +104,7 @@ export class World extends Mini3d {
...
@@ -100,6 +104,7 @@ export class World extends Mini3d {
// 创建环境光
// 创建环境光
this
.
initEnvironment
()
this
.
initEnvironment
()
this
.
init
()
this
.
init
()
console
.
log
(
"执行了 这些代码"
)
}
}
init
()
{
init
()
{
// 标签组
// 标签组
...
@@ -117,6 +122,10 @@ export class World extends Mini3d {
...
@@ -117,6 +122,10 @@ export class World extends Mini3d {
// 鼠标移上移除的材质
// 鼠标移上移除的材质
this
.
defaultMaterial
=
null
// 默认材质
this
.
defaultMaterial
=
null
// 默认材质
this
.
defaultLightMaterial
=
null
// 高亮材质
this
.
defaultLightMaterial
=
null
// 高亮材质
// 创建地形模型初始化
this
.
terrainResource
=
new
Resource
()
// 创建底部高亮
// 创建底部高亮
this
.
createBottomBg
()
this
.
createBottomBg
()
// 模糊边线
// 模糊边线
...
@@ -144,6 +153,8 @@ export class World extends Mini3d {
...
@@ -144,6 +153,8 @@ export class World extends Mini3d {
this
.
createInfoPoint
()
this
.
createInfoPoint
()
// 创建轮廓
// 创建轮廓
this
.
createStorke
()
this
.
createStorke
()
// 创造3d地形
this
.
createTerrain
()
// this.time.on("tick", () => {
// this.time.on("tick", () => {
// console.log(this.camera.instance.position);
// console.log(this.camera.instance.position);
// });
// });
...
@@ -1266,6 +1277,25 @@ export class World extends Mini3d {
...
@@ -1266,6 +1277,25 @@ export class World extends Mini3d {
texture
.
offset
.
x
+=
0.005
texture
.
offset
.
x
+=
0.005
})
})
}
}
// 创建地形模型
createTerrain
()
{
console
.
log
(
"this.terrainResource"
,
this
.
terrainResource
);
// let terrainData = this.assets.instance.getResource("mapTerrain");
// console.log("terrainData", terrainData);
this
.
terrainResource
.
loaders
.
GLTF
.
load
(
"../../../public/assets/json/Scene_cq15_200.gltf"
,
(
gltf
)
=>
{
let
terrain
=
gltf
.
scene
;
this
.
scene
.
add
(
terrain
);
},
(
xhr
)
=>
{
console
.
log
((
xhr
.
loaded
/
xhr
.
total
*
100
)
+
'% 已加载'
);
},
(
error
)
=>
{
console
.
error
(
'加载模型出错:'
,
error
);
}
)
// this.scene.add(barGroup)
}
geoProjection
(
args
)
{
geoProjection
(
args
)
{
return
geoMercator
().
center
(
this
.
geoProjectionCenter
).
scale
(
this
.
geoProjectionScale
).
translate
([
0
,
0
])(
args
)
return
geoMercator
().
center
(
this
.
geoProjectionCenter
).
scale
(
this
.
geoProjectionScale
).
translate
([
0
,
0
])(
args
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论