1.0.14 • Published 5 months ago

@ridp/threejs v1.0.14

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

@ridp/threejs

Hooks

  • useThreeJs 声明:

    /**
    * 
    * @param {String} selector  ID  '#xxxx'
    * @param {Object} option - 初始化参数
    * @property {Boolean} option.css3d - 模型
    * @returns any
    */
    function useThreeJs(selector, option)

    使用:

    import { useThreeJs } from '@ridp/threejs'
    
    const { scene, camera, renderer, control, domWidth, domHeight, isReady, addAnimate, frameArea } = useThreeJs("#InsId", )

    返回变量:

    • scene

       THREE.Scene     
    • camera:

       THREE.PerspectiveCamera 
    • renderer
       const renderer = new WebGLRenderer({
          antialias: true,
          alpha: true,
          precision: "mediump",
          logarithmicDepthBuffer: true,
      })
    • control
      THREE.OrbitControls
    • domWidth
          ref(Number)
    • domHeight
          ref(Number)
    • isReady
        ```javascript
            ref(Boolean)
        ```

      返回方法:
    • addAnimate

      /**
          * 循环帧中添加执行函数
          * @param {*} animate 
      */
      function addAnimate(animate): void
    • frameArea

      /**物体视窗自动适应
          *
          * @param {Object3D} model
          * @param {Number} scale
          * @param {Camera} camera
          * @param {OrbitControls} controls
          * @param {Vector3} offset
      */
      function frameArea(model, scale, camera, controls, offset): void
  • useRaycaster

  • useObb
  • useGLTFLoader

Instance 实例

Utils 工具

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.0

6 months ago

1.0.1

6 months ago

0.2.0

6 months ago

0.1.0

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago