Please wait while we load the game details.
# Plutus Three.js Environment 2 (gun_master style) Scene, lighting, linear fog, optional arena map (ground, walls, obstacles). Extracted from gun_master_3d. Use `scene.add(mesh)` for your objects. Requires Three.js `>= 0.150.0`, ES modules. **Install:** `npm install three`. Build: `cd environment2 && npm run build`. Preview: `npm run dev` → open URL. --- ## Use in your project ```ts import { createEnvironment, createScene, createLighting, createArenaMap } from 'plutus-threejs-environment2'; import * as THREE from 'three'; // Full environment (scene + lighting + arena) const { scene, lighting, map } = createEnvironment({ addMap: true, mapOptions: { ground: true, walls: true, obstacles: true }, }); // map.update(dt); map.isValidPosition(x,z); map.getObstacles(); // renderer.render(scene, camera); // Or modular: scene only, or scene + lighting const { scene } = createScene({ backgroundColor: 0xffdab9, fog: { type: 'linear', color: 0xffdab9, far: 100 } }); createLighting(scene); // Add your objects scene.add(yourMesh); ``` --- ## Run the app ```bash cd environment2 npm install npm run dev ``` --- ## Layout | File | Purpose | |------|---------| | `index.ts` | API + `createEnvironment()` | | `types.ts` | SceneOptions, LightingOptions, MapOptions | | `config.ts` | EnvConfig (gun_master style: peach bg, linear fog, green ground, orange walls) | | `createScene.ts` | Scene, background, THREE.Fog (linear) | | `createLighting.ts` | Ambient + directional, shadows | | `map.ts` | createGround, createBoundaryWalls, createObstacles, createArenaMap | | `main.ts` | Demo entry | --- ## How to change | Change | Where | |--------|--------| | Background/fog color | `createScene({ backgroundColor, fog })` or `config.ts` → EnvConfig | | Fog distance | `config.ts` → EnvConfig.fog.far | | Lighting | `createLighting(scene, { shadows, shadowMapSize })` or EnvConfig.lighting | | Ground size/color | EnvConfig.ground | | Walls | EnvConfig.walls (bounds, height, color) | | Obstacles | EnvConfig.obstacles, mapOptions.obstacleCount |