Giter Site home page Giter Site logo

omanoel / three-trackballcontrols-ts Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 171 KB

ThreeJS TrackBallControls as a standalone and typescript compatible npm module

License: MIT License

TypeScript 100.00%
threejs trackball three controls camera controller

three-trackballcontrols-ts's Introduction

ThreeJS Trackball Controls

as a standalone and typescript compatible npm module.

Non maintained since march 2021

because already provided in v0.126.1 - use that instead

import { TrackballControls } from 'three/examples/jsm/controls/TrackballControls';

Installation

npm install --save three-trackballcontrols-ts

Usage

import * as THREE from 'three';
import { TrackballControls } from 'three-trackballcontrols-ts';

const camera = new THREE.SomeCamera(...);
const controls = new TrackballControls(camera, renderer.domElement);

Credit

All credit goes to TrackballControls.js contributors.

three-trackballcontrols-ts's People

Contributors

omanoel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tianyazjq

three-trackballcontrols-ts's Issues

'Perspective Camera' is not assignable to parameter of type 'PerspectiveCamera | OrthographicCamera'.

Complete message trace.

Argument of type 'PerspectiveCamera' is not assignable to parameter of type 'PerspectiveCamera | OrthographicCamera'.
  Type 'THREE.PerspectiveCamera' is not assignable to type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/cameras/PerspectiveCamera").PerspectiveCamera'.
    The types of 'matrixWorldInverse.copy' are incompatible between these types.
      Type '(m: THREE.Matrix4) => THREE.Matrix4' is not assignable to type '(m: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Matrix4").Matrix4) => import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Matrix4").Matrix4'.
        Types of parameters 'm' and 'm' are incompatible.
          Type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Matrix4").Matrix4' is not assignable to type 'THREE.Matrix4'.
            Types of property 'extractBasis' are incompatible.
              Type '(xAxis: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3, yAxis: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3, zAxis: import(".../node_modules/three-...' is not assignable to type '(xAxis: THREE.Vector3, yAxis: THREE.Vector3, zAxis: THREE.Vector3) => THREE.Matrix4'.
                Types of parameters 'xAxis' and 'xAxis' are incompatible.
                  Type 'THREE.Vector3' is not assignable to type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3'.
                    Types of property 'copy' are incompatible.
                      Type '(v: THREE.Vector3) => THREE.Vector3' is not assignable to type '(v: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3) => import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3'.
                        Types of parameters 'v' and 'v' are incompatible.
                          Type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3' is not assignable to type 'THREE.Vector3'.
                            Types of property 'project' are incompatible.
                              Type '(camera: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/cameras/Camera").Camera) => import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Vector3").Vector3' is not assignable to type '(camera: THREE.Camera) => THREE.Vector3'.
                                Types of parameters 'camera' and 'camera' are incompatible.
                                  Type 'THREE.Camera' is not assignable to type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/cameras/Camera").Camera'.
                                    The types of 'parent.customDepthMaterial.copy' are incompatible between these types.
                                      Type '(material: THREE.Material) => THREE.Material' is not assignable to type '(material: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/materials/Material").Material) => import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/materials/Material").Material'.
                                        Types of parameters 'material' and 'material' are incompatible.
                                          Type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/materials/Material").Material' is not assignable to type 'THREE.Material'.
                                            Types of property 'onBeforeCompile' are incompatible.
                                              Type '(shader: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/renderers/shaders/ShaderLib").Shader, renderer: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/renderers/WebGLRenderer").WebGLRenderer) => void' is not assignable to type '(shader: THREE.Shader, renderer: THREE.WebGLRenderer) => void'.
                                                Types of parameters 'renderer' and 'renderer' are incompatible.
                                                  Type 'THREE.WebGLRenderer' is not assignable to type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/renderers/WebGLRenderer").WebGLRenderer'.
                                                    The types of 'shadowMap.render' are incompatible between these types.
                                                      Type '(shadowsArray: THREE.Light[], scene: THREE.Scene, camera: THREE.Camera) => void' is not assignable to type '(shadowsArray: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/lights/Light").Light[], scene: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/scenes/Scene").Scene, camera: import(".../node_modules/...'.
                                                        Types of parameters 'shadowsArray' and 'shadowsArray' are incompatible.
                                                          Type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/lights/Light").Light[]' is not assignable to type 'THREE.Light[]'.
                                                            Type 'import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/lights/Light").Light' is not assignable to type 'THREE.Light'.
                                                              The types of 'shadow.camera.parent.normalMatrix.getInverse' are incompatible between these types.
                                                                Type '{ (matrix: import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Matrix3").Matrix3): import(".../node_modules/three-trackballcontrols-ts/node_modules/three/src/math/Matrix3").Matrix3; (matrix: import(".../node_modules/three-t...' is not assignable to type '{ (matrix: THREE.Matrix3): THREE.Matrix3; (matrix: THREE.Matrix4, throwOnDegenerate?: boolean): THREE.Matrix3; }'.
                                                                  Types of parameters 'matrix' and 'matrix' are incompatible.
                                                                    Type 'Matrix4' is missing the following properties from type 'Matrix3': setFromMatrix4, getNormalMatrix, transposeIntoArray, setUvTransform, and 2 more.

Looks like an old version of three was used? As my page renders fine, yet vs-code complains.

my package.json

    "three": "^0.121.1",
    "three-trackballcontrols-ts": "^0.2.2",
    "typescript": "^4.0.3"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.