Skip to content

three 视角调整 #44

@msforest

Description

@msforest
resetCameraPos = (position = new THREE.Vector3(0, 0, 0)) => {
    this.controls.target.copy(position);
    this.controls3d.target.copy(position);

    const pos = new THREE.Vector3(
      PARAMS.camera.position.x,
      PARAMS.camera.position.y,
      PARAMS.camera.position.z,
    );
    this.camera.position.copy(position.add(pos));
    this.camera.updateProjectionMatrix();
    this.controls.update();
    this.controls3d.update();
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions