Skip to content

PresentationControls doesn't trigger invalidate() onChange #1529

@stefanwagnerdev

Description

@stefanwagnerdev
  • three version: 0.153.0
  • @react-three/fiber version: 8.13.3
  • @react-three/drei version: 9.74.16
  • node version: v18.16.0
  • npm (or yarn) version: 9.5.1

Problem description:

Camera does not render the scene if presentation controls are used

Relevant code:

https://codesandbox.io/s/cocky-dust-ql5qnq?file=/src/index.jsx:0-539

<Canvas frameloop="demand" camera={{ position: [2, 2, 3], fov: 25 }}>
    <PresentationControls
        config={{ mass: 1, tension: 170, friction: 26 }}
        polar={[0, 0]}
        azimuth={[-Math.PI / 10, Math.PI / 10]}
    >
        <group position={[-.4, 0, 0.6]}>
           <mesh castShadow rotation={[0, 0, 0]}>
              <boxGeometry args={[0.1, 0.1, 0.1]} />
              <meshStandardMaterial color="#FFFFFF" />
          </mesh>
        </group>
    </PresentationControls>
    <ContactShadows opacity={0.5} blur={1.5} far={0.9} />
</Canvas>

Suggested solution:

Is it possible to add an invalidate() if the PresentationControls are animating? Maybe in onChange?

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleInactive issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions