Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs_vsofpm
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
cs_vsofpm
Commits
b6e682fa
Commit
b6e682fa
authored
Dec 08, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
73e36e17
Pipeline
#6266
passed with stages
in 7 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
index.jsx
src/components/PointViewer/index.jsx
+12
-9
index.jsx
src/pages/checkhomework/index.jsx
+1
-0
No files found.
src/components/PointViewer/index.jsx
View file @
b6e682fa
...
...
@@ -10,31 +10,34 @@
*/
import
{
Gltf
,
OrbitControls
,
Stage
}
from
"@react-three/drei"
;
import
{
Canvas
}
from
"@react-three/fiber"
;
import
{
useRef
}
from
"react"
;
import
"./index.less"
;
function
Sphere
({
position
,
CoordinatePoint
,
CurGongjianPoint
})
{
console
.
log
({
position
,
CoordinatePoint
,
CurGongjianPoint
});
const
meshRef
=
useRef
();
return
(
<
mesh
ref=
{
meshRef
}
scale=
{
100
}
position=
{
position
?
Object
.
values
(
position
)?.
map
((
it
,
i
)
=>
{
const
offset
=
Object
.
values
(
CoordinatePoint
);
const
offset1
=
Object
.
values
(
CurGongjianPoint
);
cons
t
res
=
parseFloat
(
it
/
1
000
)
+
parseFloat
(
offset
[
i
])
-
parseFloat
(
offset1
[
i
]);
console
.
log
(
res
)
;
const
diyoffset
=
i
===
0
?
0
:
i
===
1
?
0.012
:
0.03
;
le
t
res
=
parseFloat
(
it
*
10000
000
)
+
parseFloat
(
offset
[
i
]
*
10000000000
)
-
parseFloat
(
offset1
[
i
]
*
10000000000
);
res
=
res
/
10000000000
;
const
diyoffset
=
i
===
0
?
0
.021
:
i
===
1
?
0.012
:
0.005
;
return
(
res
+
diyoffset
)
*
100
;
})
:
[]
}
>
<
sphereGeometry
attach=
"geometry"
args=
{
[
0.00
2
,
32
,
32
]
}
/>
<
sphereGeometry
attach=
"geometry"
args=
{
[
0.00
6
,
32
,
32
]
}
/>
<
meshPhysicalMaterial
attach=
"material"
color=
"red"
/>
</
mesh
>
);
...
...
@@ -70,7 +73,7 @@ function PointViewer({ position, CoordinatePoint, CurGongjianPoint }) {
receiveShadow
castShadow
position=
{
[
0
,
0
,
0
]
}
scale=
{
2
5
0
}
scale=
{
2
4
0
}
inject=
{
<
meshPhysicalMaterial
color=
"white"
...
...
src/pages/checkhomework/index.jsx
View file @
b6e682fa
...
...
@@ -472,6 +472,7 @@ function Checkhomework() {
getContainer={false}
title={false}
closable={false}
destroyOnClose
>
<PointViewer
position={drawer?.position}
...
...
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