@xiping/three-store
v1.0.60
Published
A lightweight wrapper around Three.js for easier 3D scene management and rendering.
Readme
three-store
A lightweight wrapper around Three.js for easier 3D scene management and rendering.
Features
- Simple scene initialization and management
- Built-in camera and renderer setup
- Orbit controls for scene navigation
- Support for loading OBJ models
- Environment map integration
- Lighting utilities (Directional and Ambient lights)
Installation
Choose your preferred package manager:
# npm
npm install @xiping/three-store
# yarn
yarn add @xiping/three-store
# pnpm
pnpm add @xiping/three-storeUsage
import ThreeStore from '@xiping/three-store';
// Initialize the store
const threeStore = new ThreeStore();
// Initialize with a DOM element
threeStore.init({
domElement: document.getElementById('your-container')
});
// The store provides methods for:
// - Scene management
// - Camera control
// - Lighting setup
// - Model loading
// - Environment map integrationAPI
Constructor
const threeStore = new ThreeStore();Methods
init(props: InitProps)
Initializes the Three.js scene with the provided DOM element.
interface InitProps {
domElement: HTMLElement;
}Dependencies
- three.js: ^0.162.0
Development
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run buildLicense
MIT
