This commit is contained in:
quantulr
2023-12-25 10:44:13 +08:00
parent 18fd617a01
commit 784fe1d051
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,5 @@
import useModelStore, { DecalSticker } from "@/store/useModelStore"; import useModelStore, { DecalSticker } from "@/store/useModelStore";
import { Decal, useTexture } from "@react-three/drei"; import { Decal, useTexture } from "@react-three/drei";
import { Euler } from "three";
/** /**
* logo 和文字标签 * logo 和文字标签
@ -17,7 +16,7 @@ const Sticker = ({ decal }: { decal: DecalSticker }) => {
// }, 10) // }, 10)
return ( return (
<Decal <Decal
debug={true} // debug={true}
position={decal.postion} position={decal.postion}
scale={decal.scale} scale={decal.scale}
onPointerDown={(ev) => { onPointerDown={(ev) => {
@ -48,8 +47,8 @@ const Sticker = ({ decal }: { decal: DecalSticker }) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error // @ts-expect-error
rotation={Math.PI} rotation={Math.PI}
// rotation={new Euler(Math.PI / 2, 0, 0)} // rotation={new Euler(Math.PI / 2, 0, 0)}
// rotation={[Math.PI * 1, Math.PI * 1, Math.PI * 1]} // rotation={[Math.PI * 1, Math.PI * 1, Math.PI * 1]}
> >
<meshPhysicalMaterial <meshPhysicalMaterial
transparent transparent

View File

@ -135,14 +135,13 @@ export const Stickers = () => {
}; };
const ThreeScene = () => { const ThreeScene = () => {
// const hdr = useTexture("/venice_sunset_1k.hdr")
return ( return (
<Canvas> <Canvas>
<ambientLight></ambientLight> <ambientLight></ambientLight>
<pointLight position={[10, 10, 10]}></pointLight> <pointLight position={[10, 10, 10]}></pointLight>
<perspectiveCamera /> <perspectiveCamera />
<CapModel /> <CapModel />
<axesHelper /> {/* <axesHelper /> */}
<Environment files={"/venice_sunset_1k.hdr"} background={false} /> <Environment files={"/venice_sunset_1k.hdr"} background={false} />
</Canvas> </Canvas>
); );