1.0.3 • Published 3 years ago

bimgl v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

bimgl.js npm version

JavaScript 3D library

The project is a web GL rendering library, with BIM life cycle related functions and operations

Installation

 npm install bimgl
      or
 yarn add bimgl

Example

docs address 演示地址

<div id='viewer'></div>
import BIMGL from "bimgl";
const bimgl = new BIMGL();
bimgl.init(document.getElementById('viewer'),{
    uri: `modelURL`,
})

init

import BIMGL from "BIMGL";
const bimgl = new BIMGL();
bimgl.init(element,options);

Options

KeyTypeDefaultDescription
* uristring模型加载地址
antialiasbooleanfalse抗锯齿
widthnumberel.width场景宽度
heightnumberel.height场景高度
selectColor十六进制0x5cadff构件选中颜色
loadingImagestring加载图片地址
clearColor十六进制0xb9d3ff场景背景色
animationFunctionnull帧循环

Event

  • new Color ( 十六进制 ) - 实例化一个颜色
  • resize (width,height) - 更改场景的大小
  • render () - 重新渲染
  • onload () - 模型加载完成
  • onError () => error - 模型加载失败
  • onStart () - 模型加载开始
  • onProgress (进度百分比) - 模型加载进度
  • destroy () - 销毁模型
  • onSelect () => 构件 - 构件选中
  • transparentComponentsById _( componentsId , opacity0.0-1.0) 将构件透明化
  • setComponentsColorById _( componentsId , Color) 构建着色
  • clearComponentsColorById _( componentsId ) 通过构件id清除构件着色
  • setWorldPosition _(componentsId, element, position ? ) 通过构件id给模型加标签
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago