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 @@
*/
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);
const res =
parseFloat(it / 1000) +
parseFloat(offset[i]) -
parseFloat(offset1[i]);
console.log(res);
const diyoffset = i === 0 ? 0 : i === 1 ? 0.012 : 0.03;
let res =
parseFloat(it * 10000000) +
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.002, 32, 32]} />
<sphereGeometry attach="geometry" args={[0.006, 32, 32]} />
<meshPhysicalMaterial attach="material" color="red" />
</mesh>
);
......@@ -70,7 +73,7 @@ function PointViewer({ position, CoordinatePoint, CurGongjianPoint }) {
receiveShadow
castShadow
position={[0, 0, 0]}
scale={250}
scale={240}
inject={
<meshPhysicalMaterial
color="white"
......
......@@ -472,6 +472,7 @@ function Checkhomework() {
getContainer={false}
title={false}
closable={false}
destroyOnClose
>
<PointViewer
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