1. ModelFlicker

BIM模型闪烁接口,参数:闪烁模型数组、颜色、透明度、闪烁时间间隔

1.1. new ModelFlicker([options])

Param Type Default Description
[options] Object

参数配置

[options.color] String '#ff0000'

十六进制的颜色字符串

[options.opacity] Number 1

透明度

[options.interval] Number 3

时间间隔

Example

var modelFlicker = new BOSGeo.ModelFlicker({
    color: "#0000ff",
    opacity: 0.9,
    interval: 3
});

1.2. modelFlicker.on(models, [options])

开启模型闪烁

Param Type Default Description
models Array

闪烁模型的数组

[options] Object

闪烁的样式配置

[options.color] String '#ff0000'

十六进制的颜色字符串

[options.opacity] Number 1

透明度

[options.interval] Number 3

时间间隔

Example

let model = modelLayer.add({
    name: '模型3DTiles',
    // url: 'https://lab.earthsdk.com/model/887b3db0cd4f11eab7a4adf1d6568ff7/tileset.json',
    url: 'https://bosgw.bimwinner.com/bos3dengine/api/i432ee7c3af141249915d154d92084ca/geomodels/G1618196965800/data/tileset.json',
    featureType: BOSGeo.FeatureType.BIM,
    position: [113.107767, 23.02872, 25.78]
});

let gltfModel = modelLayer.add({
    name: 'gltfModel',
    url: 'http://localhost/build/tiyuguan.glb',
    featureType: BOSGeo.FeatureType.GLTF,
    position: [113.107, 23.0276, 100],
    rotation: [0, 90, 0],
    scale: 0.001
});
//创建模型对象数组
var models = [model, gltfModel];

var modelFlicker = new BOSGeo.ModelFlicker();
modelFlicker.on(models, {
    color: "#00ff00",
    opacity: 0.5
});

1.3. modelFlicker.off(models)

关闭模型闪烁

Param Type Description
models Array

闪烁模型的数组

Example

let model = modelLayer.add({
    name: '模型3DTiles',
    // url: 'https://lab.earthsdk.com/model/887b3db0cd4f11eab7a4adf1d6568ff7/tileset.json',
    url: 'https://bosgw.bimwinner.com/bos3dengine/api/i432ee7c3af141249915d154d92084ca/geomodels/G1618196965800/data/tileset.json',
    featureType: BOSGeo.FeatureType.BIM,
    position: [113.107767, 23.02872, 25.78]
});

let gltfModel = modelLayer.add({
    name: 'gltfModel',
    url: 'http://localhost/build/tiyuguan.glb',
    featureType: BOSGeo.FeatureType.GLTF,
    position: [113.107, 23.0276, 100],
    rotation: [0, 90, 0],
    scale: 0.001
});
//创建模型对象数组
var models = [model, gltfModel];

var modelFlicker = new BOSGeo.ModelFlicker();
modelFlicker.on(models, {
    color: "#00ff00",
    opacity: 0.5
});
// 关闭模型闪烁
modelFlicker.off(models);
版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-02-22 17:53:54

results matching ""

    No results matching ""