# 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:

```bash
# npm
npm install @xiping/three-store

# yarn
yarn add @xiping/three-store

# pnpm
pnpm add @xiping/three-store
```

## Usage

```typescript
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 integration
```

## API

### Constructor

```typescript
const threeStore = new ThreeStore();
```

### Methods

#### init(props: InitProps)
Initializes the Three.js scene with the provided DOM element.
```typescript
interface InitProps {
  domElement: HTMLElement;
}
```

## Dependencies

- three.js: ^0.162.0

## Development

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build
```

## License

MIT
