A modern website inspired by WWT Digital's design, featuring a 3D interactive header section built with Three.js.
- 3D Interactive Header: Mouse hover rotates the 3D object
- GLB Model Support: Ready to load your .glb 3D models
- Responsive Design: Works on desktop, tablet, and mobile
- Modern UI: Clean, professional design matching WWT Digital's style
- Smooth Animations: CSS animations and Three.js interactions
- Place your
.glbfile in the project directory - Open the browser console and call:
loadGLBModel('path/to/your/model.glb')
Or edit script.js and uncomment the last line, replacing the path:
loadGLBModel('path/to/your/model.glb');- Mouse Hover: Move mouse over the 3D container to rotate the object
- Smooth Animation: Object smoothly follows mouse movement
- Auto Rotation: Gentle continuous rotation when not hovering
- Responsive: 3D container adapts to screen size
index.html- Main HTML structurestyles.css- All styling and responsive designscript.js- Three.js setup and 3D interactionsREADME.md- This documentation
- Three.js (loaded via CDN)
- GLTFLoader (loaded via CDN)
Works in all modern browsers that support WebGL and Three.js.
Edit the createPlaceholderObject() function in script.js to modify:
- Object size, color, material
- Initial position and rotation
Modify these values in the onMouseMove() function:
targetRotation.y = mouse.x * 0.3; // Horizontal sensitivity
targetRotation.x = mouse.y * 0.2; // Vertical sensitivityChange the interpolation speed in the animate() function:
currentRotation.x += (targetRotation.x - currentRotation.x) * 0.05; // Smoothness factor- Open
index.htmlin a web browser - The 3D container will show a placeholder blue cube
- Hover over the 3D area to see the interaction
- Replace with your GLB model using the instructions above