项目作者: Nesh108

项目描述 :
Voxel Clouds for Babylon.js
高级语言: JavaScript
项目地址: git://github.com/Nesh108/babylon-voxel-clouds.git
创建时间: 2017-03-24T05:12:14Z
项目社区:https://github.com/Nesh108/babylon-voxel-clouds

开源协议:MIT License

下载


Babylon Voxel Clouds

Voxel clouds for Babylon.js

Clouds for Babylon.js.

Best when used with Noa-Engine.

Example

  1. let cloud_generator = require('babylon-voxel-clouds')();
  2. // If the block is above the clouds level and below the maximum clouds altitude, then set it
  3. if (y >= clouds_generator.get_cloud_level() && y <= clouds_generator.get_cloud_altitude()) {
  4. let cloud = clouds_generator.get_cloud_index(x, y, z);
  5. if (y < clouds_generator.get_cloud_level() + 10) {
  6. cloud *= (y - clouds_generator.get_cloud_level()) / 10;
  7. }
  8. if (cloud > clouds_generator.get_cloud_cutoff()) {
  9. // SET BLOCK AS CLOUD
  10. block.set(x, y, z, 'cloud');
  11. }
  12. }

Run the Example

  1. git clone git://github.com/Nesh108/babylon-voxel-clouds && cd babylon-voxel-clouds
  2. npm install
  3. npm start

Install

With npm do:

  1. npm install --save babylon-voxel-clouds

Release History

  • 1.0.0 - initial release

License

Credit to Andy Hall (https://github.com/andyhall)

Copyright (c) 2017 Nesh108

Licensed under the MIT license.