Commit b6e682fa authored by wuhao's avatar wuhao 🎯

asder

parent 73e36e17
Pipeline #6266 passed with stages
in 7 minutes and 55 seconds
...@@ -10,31 +10,34 @@ ...@@ -10,31 +10,34 @@
*/ */
import { Gltf, OrbitControls, Stage } from "@react-three/drei"; import { Gltf, OrbitControls, Stage } from "@react-three/drei";
import { Canvas } from "@react-three/fiber"; import { Canvas } from "@react-three/fiber";
import { useRef } from "react";
import "./index.less"; import "./index.less";
function Sphere({ position, CoordinatePoint, CurGongjianPoint }) { function Sphere({ position, CoordinatePoint, CurGongjianPoint }) {
console.log({ position, CoordinatePoint, CurGongjianPoint }); const meshRef = useRef();
return ( return (
<mesh <mesh
ref={meshRef}
scale={100} scale={100}
position={ position={
position position
? Object.values(position)?.map((it, i) => { ? Object.values(position)?.map((it, i) => {
const offset = Object.values(CoordinatePoint); const offset = Object.values(CoordinatePoint);
const offset1 = Object.values(CurGongjianPoint); const offset1 = Object.values(CurGongjianPoint);
const res = let res =
parseFloat(it / 1000) + parseFloat(it * 10000000) +
parseFloat(offset[i]) - parseFloat(offset[i] * 10000000000) -
parseFloat(offset1[i]); parseFloat(offset1[i] * 10000000000);
console.log(res); res = res / 10000000000;
const diyoffset = i === 0 ? 0 : i === 1 ? 0.012 : 0.03; const diyoffset = i === 0 ? 0.021 : i === 1 ? 0.012 : 0.005;
return (res + diyoffset) * 100; return (res + diyoffset) * 100;
}) })
: [] : []
} }
> >
<sphereGeometry attach="geometry" args={[0.002, 32, 32]} /> <sphereGeometry attach="geometry" args={[0.006, 32, 32]} />
<meshPhysicalMaterial attach="material" color="red" /> <meshPhysicalMaterial attach="material" color="red" />
</mesh> </mesh>
); );
...@@ -70,7 +73,7 @@ function PointViewer({ position, CoordinatePoint, CurGongjianPoint }) { ...@@ -70,7 +73,7 @@ function PointViewer({ position, CoordinatePoint, CurGongjianPoint }) {
receiveShadow receiveShadow
castShadow castShadow
position={[0, 0, 0]} position={[0, 0, 0]}
scale={250} scale={240}
inject={ inject={
<meshPhysicalMaterial <meshPhysicalMaterial
color="white" color="white"
......
...@@ -472,6 +472,7 @@ function Checkhomework() { ...@@ -472,6 +472,7 @@ function Checkhomework() {
getContainer={false} getContainer={false}
title={false} title={false}
closable={false} closable={false}
destroyOnClose
> >
<PointViewer <PointViewer
position={drawer?.position} position={drawer?.position}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment