ca-grow-ops-manager/INSTRUCTIONS_3D_VIEWER.md
fullsizemalt 1701a046f6
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run
feat: 3d viewer improvements and realistic seed data
2025-12-17 16:10:14 -08:00

36 lines
1.4 KiB
Markdown

# 3D Facility Viewer Updates
I've updated the 3D Viewer to improve navigation and usability, and fixed the issue where plants were floating in the void.
## 🚀 Enhancements Added
1. **Quick Navigation Sidebar**: A list of rooms is now displayed on the left. Clicking a room name smoothly flies the camera to that location.
2. **WASD Controls**: You can now use `W`, `A`, `S`, `D` (and arrow keys) to move the camera around the facility.
3. **Smooth Camera Transitions**: Replaced standard controls with `CameraControls` for cinematic transitions between rooms.
4. **Reset View**: Added a button to reset the view to the facility center.
## ⚠️ Important: Fix "Floating Plants" Data
The issue where plants appeared far away from rooms was caused by missing coordinate data in the database. I have updated the seed script to generate realistic 3D layout data.
**You must re-seed the database for the 3D view to look correct.**
Run the following command on your deployment server (or locally if you have the DB running):
```bash
# If running via Docker Compose (Recommended)
docker compose exec backend npm run seed
```
Or if you are running the backend locally with a `.env` file containing `DATABASE_URL`:
```bash
cd backend
npm run seed
```
This will populate the database with:
- Spatially aware Rooms (Veg, Flower, Dry)
- Correctly positioned Racks and Benches
- Plants placed inside those racks