Pure Three.js portfolio shell with a retro CLI loading screen, a 3D computer scene, and an interactive CSS3D iframe attached to the monitor mesh.
- Main computer mesh:
public/models/computer.glb - Extra mesh files:
public/models/ - Draco decoder files, only if your GLB needs them:
public/draco/ - Existing 2D portfolio build: replace
public/portfolio/with your exported static files - Hosted 2D portfolio URL: set
VITE_PORTFOLIO_URLin.env
The default model path is configured in src/portfolio-config.js and can be overridden with:
VITE_COMPUTER_MODEL=/models/my-computer.glbnvm use
npm install
npm run devThen open the local URL printed by Vite.
The project targets Node 20.19+ / 22+ because modern Vite requires it. In WSL, use the included .nvmrc with nvm use if you manage Node through nvm.
- Export the computer as
.glbor.gltf. - Put it in
public/models/. - Either name it
computer.glb, or updateVITE_COMPUTER_MODEL. - Start the site and adjust
SCREEN_PLANEinsrc/portfolio-config.js.
SCREEN_PLANE attaches the iframe to the named monitor mesh in computer.glb. If the iframe is slightly off, tune position, rotation, width, and height there. The current parent target is:
SM_Computer_B_Monitor.mo_MI_Computer_B_0.001For a local static portfolio, copy its production build into public/portfolio/ so this file exists:
public/portfolio/index.html
For a deployed portfolio, create .env from .env.example and set:
VITE_PORTFOLIO_URL=https://www.neodoggy.orgSome websites block iframe embedding with security headers. If your hosted 2D site does not appear, use the local static-build option or adjust the original site's X-Frame-Options / Content-Security-Policy settings.
This project keeps the 3D rendering path simple and fast: Three.js renders the room and computer mesh, while Three's CSS3DRenderer keeps the portfolio as a real iframe attached to the monitor in 3D space. That means your original 2D site stays clickable and does not need to be converted into a texture.
When running in WSL, start Vite from the same folder you are editing. For this workspace that is usually:
cd /mnt/d/git/3Dportfolio
npm run dev