跨~界开发者中心 跨~界开发者中心
首页
  • 开发环境
  • 转换服务
  • API接口

    • 基础类
    • 工具类
    • 界面类
    • 场景类
    • 构件类
    • 标签装饰类
    • 地图实景类
    • 模型类
    • 事件类
    • 相机类
    • 脚本类
    • 几何类
  • 初版接口

    • 全局接口
    • 工具接口
    • API接口
  • 框架相关
  • 界面相关
  • 场景相关
  • 模型相关
  • 工具相关
  • 功能模块

    • 脚本接口
  • API示例

    • API示例说明
    • API示例下载
  • SDK示例

    • UIApp
    • SceneApp
    • ViewsApp
    • GeometryApp
    • ElementApp
    • ToolApp
访问新版 (opens new window)
首页
  • 开发环境
  • 转换服务
  • API接口

    • 基础类
    • 工具类
    • 界面类
    • 场景类
    • 构件类
    • 标签装饰类
    • 地图实景类
    • 模型类
    • 事件类
    • 相机类
    • 脚本类
    • 几何类
  • 初版接口

    • 全局接口
    • 工具接口
    • API接口
  • 框架相关
  • 界面相关
  • 场景相关
  • 模型相关
  • 工具相关
  • 功能模块

    • 脚本接口
  • API示例

    • API示例说明
    • API示例下载
  • SDK示例

    • UIApp
    • SceneApp
    • ViewsApp
    • GeometryApp
    • ElementApp
    • ToolApp
访问新版 (opens new window)
  • SDK接口

    • 框架相关

      • KsjSampleApp
    • 界面相关

      • UI
    • 场景相关

      • Scene
      • Camera
        • BaseDecorator
        • MapInterface
      • 模型相关

        • ElementInterface
        • ElementAttribute
      • 工具相关

        • 基础工具
      • 功能模块

        • 脚本接口

          • 脚本接口总览
          • ScriptControl
          • Action
          • CameraAction_ViewPoint
          • CameraAction_PosAndTarget
          • CameraAction_RotateTarget
          • CameraAction_Line
          • CameraAction_Line2
          • ElementMoveAction
          • ElementRotateAction
          • MovedElementRotateAction
          • ElementMoveAndRotateAction
          • ElementMoveAndScaleAction
          • ElementMoveAndRotateAndScaleAction
          • AppearanceAction_AllTransparency
          • AppearanceAction_Transparency
          • AppearanceAction_AllColor
          • AppearanceAction_Color
          • AppearanceAction_TransparencyChange
          • ClipAction_ClipOpenOne
          • ClipAction_ClipOpenMore
          • ClipAction_ClipWithLine
    目录

    Camera

    三维相机相关接口。

    来源于@ksj/bw

    接口 说明
    turnOnCamera 三维场景开启相机模式。
    turnOffCamera 三维场景关闭相机模式。
    isCameraOn 三维场景相机模式是否开启。
    setCameraPosAndTarget 设置相机位置和目标点。
    getEyePoint 获取当前相机坐标。
    getTarget 获取当前相机目标点坐标。
    zoomToElement 聚焦到构件。
    fitView 视野自动适应当前场景。
    fitViewWithDirectionAndUp 指定视野方向并自适应当前场景。
    getViewPointData 获取当前视口设置相关信息。

    # 1. turnOnCamera

    场景开启相机模式。

    static turnOnCamera()

    参数: 无。

    返回: 无。

    # 2. turnOffCamera

    场景关闭相机模式。

    static turnOffCamera()

    参数: 无。

    返回: 无。

    # 3. isCameraOn

    当前场景是否开启了相机模式。

    static isCameraOn()

    参数: 无。

    返回: 无。

    # 4. setCameraPosAndTarget

    设置相机的位置和观察目标点。

    static setCameraPosAndTarget( pos:Point3d, target:Point3d, upVector?:Vector3d )

    参数:

    pos: 相机位置点。
    
    target: 相机观察目标点。
    

    upVector: 相机上向。注意:相机上方向不能与 相机朝向(target-pos)同向。

    返回: 无。

    # 5. getEyePoint

    获取当前相机位置。

    static getEyePoint():Point3d|undefined

    参数: 无。

    返回:

    成功 返回相机位置点坐标。

    失败 返回 undefined。

    # 6. getTarget

    获取当前相机观察目标点。

    static getTarget():Point3d|undefined

    参数: 无。

    返回:

    成功  返回相机观察目标点坐标。
    
    失败  返回 undefined。。
    

    # 7. zoomToElement

    聚焦到构件。

    static async zoomToElement( ids:string[] )

    参数:

    ids: 要聚焦的构件的ID的数组。
    

    返回: 无。

    示例:

    略

    # 8. fitView

    当前视野自适应。

    static fitView()

    参数: 无。

    返回: 无。

    # 9. fitViewWithDirectionAndUp

    设置相机方位并自适应当前场景。

    static fitViewWithDirectionAndUp( direction:string, upDir:string )

    参数:

    direction: 相机朝向。"正上"|"正前"|"正后"|"正左"|"正右"|"正下"。
    
    upDir: 相机上向。"正上"|"正前"|"正后"|"正左"|"正右"|"正下"。注:相机上向与朝向不能共线,即不能同向和反向。
    

    返回: 无。

    # 10. getViewPointData

    获取当前相机信息,包含当前相机视野截图。

    static getViewPointData():any

    参数: 无。

    返回:

    失败 返回 undefined。

    成功 返回场景视口基本设置。

    {
    	dis:number,
    	orgin:Point3d,
    	extents:Point3d,
    	eyePoint:Point3d, // 视野目标点
    	angles:YawPitchRollAngles, // 相机角度。
    	imgSrc:ang // 当前视口截图。
    };
    
    Scene
    BaseDecorator

    ← Scene BaseDecorator→

    Theme by Vdoing | Copyright © 1999-2024 | 北京跨世纪软件技术有限公司 | 京ICP备2020036512号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式