Skybox - 基于three.js的动态天空盒

价格
¥2500
服务说明
可永久使用
三个月内免费在线技术支持
三个月内免费版本升级
立即下载

PCA

1. 产品简介

Skybox是基于three.js的动态天空盒工具,实现昼夜交替,流动云层,星空闪烁,大气颜色变化功能。支持通过设置时间实现光照和阴影变换。

2. 使用说明

2.1、动态天空盒工具开发包内容

Skybox是基于three.js的动态天空盒工具,实现昼夜交替,流动云层,星空闪烁,大气颜色变化功能。Skybox支持通过设置时间实现光照和阴影变换。当前版本 V1.0,主要文件及目录组织结构如下:

开发包文件 说明
example/ SkyBox.js 使用示例目录
SkyBox.cjs.min.js cjs 格式库文件
SkyBox.esm.min.js esm 格式库文件
SkyBox.umd.min.js umd 格式库文件
LICENSE.md 开发包许可协议文件

2.2、示例程序使用方法

在example目录下运行以下命令启动示例程序:

npm install

npm run dev

2.3 API说明

设置天空盒时间

time: Number

时间范围(0 ~ 24)

mesh: THREE.Object3D

3. 代码示例

import * as THREE from 'three'
import SkyBox from 'SkyBox.esm.min.js';

.... 省略 render 代码

 /**
   创建SkyBox对象,添加到Scene中
  **/
  const skybox = new SkyBox(renderer, scene, camera)
  scene.add(skybox.object) //将天空盒添加到scene中;
  await skybox.init();//初始化天空盒

  skybox.time = 16 //修改天空盒时间为下午4点

 /** 
     在animate函数中调用render方法以实现动态云移动
 **/
 animate() {
    requestAnimationFrame(this.animate);
    this.renderer.render(this.scene, this.camera);
    skybox.render();
  }

运行效果, 上图为Skybox日落效果截图,下图为Skybox夜晚效果截图。

PCA PCA

4. 证书与授权

This software is provided by 中交简石数字科技(苏州)有限公司 (hereinafter referred to as "Licensor") under the following terms and conditions:

  1. Grant of License: Licensor hereby grants to you a non-exclusive, non-transferable license to use this software on one computer for your own personal or internal business purposes.
  2. Use Restrictions: You may not copy, modify, reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of this software. You may not sublicense, assign, rent, loan, sell, or transfer any rights in or to this software except with the express written consent of Licensor.
  3. No Export: You may not export this software to any country or region without the prior written permission of Licensor.
  4. Term and Termination: This license will remain in effect until terminated. You may terminate it at any time by destroying all copies of this software. It will also automatically terminate if you fail to comply with any term or condition of this agreement. Upon termination, you must destroy all copies of this software.
  5. Limited Warranty: Licensor warrants that the software will perform in substantial accordance with its accompanying documentation for a period of ninety (90) days from the date of delivery. If the software does not perform substantially in accordance with such documentation, Licensor will, at its option, either replace the software or refund the license fee paid by you.
Skybox - 基于three.js的动态天空盒 - NSDT
联系客服