Add grid helper

This commit is contained in:
Nettika 2026-01-28 23:44:16 -08:00
parent f0fece522d
commit 2aed1c37ce
No known key found for this signature in database
3 changed files with 11 additions and 30 deletions

31
.gitignore vendored
View file

@ -1,30 +1,3 @@
# Nix/Direnv
/.direnv/ /.direnv/
/node_modules/
# Logs /dist/
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Dependencies
node_modules
# Build output
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View file

@ -36,7 +36,7 @@ A step-by-step checklist for porting MatterControl's design features to a Vue +
- [x] Add basic lighting (ambient + two directional) - [x] Add basic lighting (ambient + two directional)
### Scene Helpers ### Scene Helpers
- [ ] Add ground grid helper (XZ plane) - [x] Add ground grid helper (XZ plane)
- [ ] Add axis helper (RGB arrows for X/Y/Z) - [ ] Add axis helper (RGB arrows for X/Y/Z)
- [ ] Add option to toggle grid visibility - [ ] Add option to toggle grid visibility
- [ ] Add option to toggle axis visibility - [ ] Add option to toggle axis visibility

View file

@ -32,6 +32,9 @@ function initScene() {
// Add lighting // Add lighting
addLighting() addLighting()
// Add grid helper
addGridHelper()
// Add a test cube to verify rendering // Add a test cube to verify rendering
addTestCube() addTestCube()
@ -42,6 +45,11 @@ function initScene() {
animate() animate()
} }
function addGridHelper() {
const gridHelper = new THREE.GridHelper(10, 10, 0x444444, 0x333333)
scene.add(gridHelper)
}
function addLighting() { function addLighting() {
// Ambient light for base illumination // Ambient light for base illumination
const ambientLight = new THREE.AmbientLight(0xffffff, 0.4) const ambientLight = new THREE.AmbientLight(0xffffff, 0.4)