Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StandaloneFrame
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
StandaloneFrame
Commits
411b673d
Commit
411b673d
authored
Oct 25, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
e26a999e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
dixing.glb
frontend/src/pages/dashboard/dixing.glb
+0
-0
index.jsx
frontend/src/pages/dashboard/index.jsx
+19
-14
model.glb
frontend/src/pages/dashboard/model.glb
+0
-0
No files found.
frontend/src/pages/dashboard/dixing.glb
0 → 100644
View file @
411b673d
File added
frontend/src/pages/dashboard/index.jsx
View file @
411b673d
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-10-19 14:49:40
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-10-25 15:59:31
* @FilePath: /standaloneframe/frontend/src/pages/dashboard/index.jsx
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import
*
as
THREE
from
"three"
;
import
React
,
{
useRef
,
Suspense
,
memo
,
useState
,
useEffect
}
from
"react"
;
import
{
GLTFLoader
}
from
"three/examples/jsm/loaders/GLTFLoader"
;
...
...
@@ -12,6 +22,8 @@ import {
}
from
"@react-three/fiber"
;
useGLTF
.
preload
(
require
(
`./model.glb`
));
useGLTF
.
preload
(
require
(
`./dixing.glb`
));
const
Mesh
=
(
props
)
=>
{
const
{
scene
,
nodes
,
materials
,
animations
}
=
useGLTF
(
props
.
path
);
...
...
@@ -49,19 +61,6 @@ const Mesh = (props) => {
castShadow
scale=
{
0.1
}
position=
{
[
0
,
0
,
0
]
}
inject=
{
<
meshPhysicalMaterial
color=
{
"#fff"
}
transparent=
{
true
}
//是否支持透明度
opacity=
{
1
}
//透明度
//visible=
{
true
}
//是否可见
metalness=
{
0.5
}
//金属性贴图
roughness=
{
2
}
//粗糙程度 越精细镜面效果越强
clearcoat=
{
1
}
// 透明漆 罩光漆
transmission=
{
0.5
}
//透光效果 模型透明 表面效果处理不变 opactiy是整体透明 不削弱反射光
reflectivity=
{
1
}
//光的 反射率
/>
}
/>
);
};
...
...
@@ -85,10 +84,16 @@ function Dashboard({}) {
<
pointLight
position=
{
[
10
,
10
,
10
]
}
/>
<
OrbitControls
/>
<
Jixie
castShadow
receiveShadow
/>
<
Gltf
src=
{
require
(
`./dixing.glb`
)
}
receiveShadow
castShadow
scale=
{
0.1
}
position=
{
[
0
,
0
,
0
]
}
/>
</
Canvas
>
</
div
>
);
}
export
default
Dashboard
;
frontend/src/pages/dashboard/model.glb
View file @
411b673d
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment