You are reading Tres v1 docs. Head over tresjs.org for V2 docs.
Skip to content
On this page

PamCameraMouse

<PamCameraMouse /> is a component that allow you to create easily the pam mouse camera effect. The camera will update automatically according to the mouse position, creating a beautiful nice effect

Usage

You only need import it and use it <PamCameraMouse /> additionally you can pass two props, disabled and factor. Factor is a number to increase the movement range of the camera

vue
<template>
  <TresCanvas>
    <PamCameraMouse />
    <TresScene>
      <Text3D text="TresJS" font="/fonts/FiraCodeRegular.json">
        <TresMeshNormalMaterial />
      </Text3D>
    </TresScene>
  </TresCanvas>
</template>

WARNING

By the nature of the pam mouse camera effect it creates conflicts if it's used in combination with OrbitControls

Props [1]

PropDescriptionDefault
disabledenable or disabled the effect, booleanfalse
factorNumber use to increase the range of the camera movement5