bp-cloner
v0.0.3
Published
More info and explanations here - https://doc.babylonjs.com/communityExtensions/clonerSystem
Maintainers
Readme
Cloner System for Babylon.js
More info and explanations here - https://doc.babylonjs.com/communityExtensions/clonerSystem
TypeDoc Documentation - https://clonersystem.babylonpress.org/docs/
Definitions:
Demo
The demo with all cloners (animated) - https://clonersystem.babylonpress.org/ (the default example scene for this repo) The demo with all cloners (static) - https://babylonpress.org/cloner/ Extensive old version documentation - https://doc.babylonjs.com/communityExtensions/clonerSystem
Playground demos
https://playground.babylonjs.com/#1MYQ3T#47 https://playground.babylonjs.com/#1WRUHY#2 https://www.babylonjs-playground.com/#1NYYEQ#5 https://www.babylonjs-playground.com/#1NYYEQ#6 https://www.babylonjs-playground.com/#1NYYEQ#7 https://playground.babylonjs.com/#JWETXJ#0
Import and Usage
npm i bp-cloner
Import needed Cloners like import { RandomEffector } from "bp-cloner";import { MatrixCloner } from "bp-cloner"
Then use like
Or if you use <script> tags see UMD and ESM variants here - https://www.jsdelivr.com/package/npm/bp-cloner?tab=files
Getting started with this repo
This is a Babylon.js project using typescript, latest babylon.js es6 core module, vite 6.
To run the basic Cloner System scene (with some animations):
- Clone / download this repository
- run
npm installto install the needed dependencies. - run
npm run devto display the test page. - To test :
npm run test, for coveragenpm run test:coverage - Build with
npm run build(only Cloner folder to dist/).
Demo Build and Preview
To build and preview the demo application:
- Build demo for production:
npm run build:demo- Creates optimized demo indist-demo/folder - Preview built demo:
npm run preview:demo- Serves the built demo at http://localhost:4173/
The demo build creates a production-ready version of the cloner showcase with all animations and effects, ready for deployment to any static hosting service.
TypeDoc Support
To generate documentation use npx typedoc --entryPointStrategy Expand src/Cloner --exclude "src/Cloner/index.ts"
Demo Scene Cloners
The demo scene (src/scene.ts) showcases 20 different cloner configurations with smooth animations:
- DNA Double Helix - Two intertwined spiral strands with connecting bars
- Pulsating Crystal Matrix - 5×5×5 grid of transparent polyhedrons with smooth pulsating
- Wave Matrix - 12×12 grid creating dynamic sine wave patterns
- Golden Spiral Galaxy - 80 elements spiraling outward using golden angle
- Morphing Sphere - Radial sphere with random position variations
- Orbiting Rings - Three concentric rings rotating at different speeds
- Fibonacci Tower - Vertical tower with Fibonacci spiral rotation
- Radial Burst - Explosive radial pattern with pulsating radius
- Helix Tower - Vertical helix structure with smooth growth animation
- Concentric Circles - Three counter-rotating circles with breathing effect
- Staircase to Heaven - Ascending stairs with dramatic expansion/contraction
- Particle Explosion - Multi-layered expanding particle system
- Twisted Ribbon - Spiraling ribbon with tightening/loosening animation
- Pyramid Structure - 3D pyramid grid with vertical oscillation
- Vortex Tunnel - Spinning tunnel with pulsing depth
- Flower Petals - Radial petals opening and closing
- Cube Lattice - 3D grid with random position/rotation variations
- Sine Wave Path - Linear path with wave motion and compression
- Spinning Blades - Radial blades with dramatic radius expansion
- Atom Model - Nucleus with three electron orbital rings
All cloners feature smooth SineEase animations on radius and growth properties, PBR materials with metallic and emissive effects, and an auto-rotating camera.
Contributors
Based on Cloner System extension https://github.com/androdlang/Extensions/tree/master/ClonerSystem by https://github.com/androdlang
Changelog
0.0.3
- Added dedicated demo build and preview commands using
vite.demo.config.ts - Fixed
RadialClonerconstructoroffsethandling to consistently use degree-based public API values - Fixed nested
LinearClonerrotation cloning so rotations are not double-converted - Fixed
MatrixClonerroot lifecycle when changingmcount - Fixed matrix and thin-instance export logic to include wrapper-node transforms such as
ObjectClonerscaling
