如视 Five SDK
    Preparing search index...

    Function useFiveProject2d

    • Function

      Five React Hooks: 将三维的坐标对应到而为屏幕

      preject2d

      计算模型射线碰撞检测
      // param vector 三维的坐标
      // param testModel 是否和模型检测,如果检测,则被模型遮挡会返回 null
      // returns 三维的坐标 或者 null
      preject2d(vector: THREE.Vector3, testModel: boolean): THREE.Vector2null

      Returns (vector: Vector3, testModel: boolean) => Vector2

      const preject2d = useFiveProject2d();
      const { x: width, y: height } = preject2d(new THREE.Vector3(0, 0, 0));