{"id":14981190,"url":"https://github.com/yousseffdil/three-js-tracker-object-mouse","last_synced_at":"2026-02-12T08:31:22.316Z","repository":{"id":252304512,"uuid":"840035884","full_name":"yousseffdil/three-js-tracker-object-mouse","owner":"yousseffdil","description":"A Three.js box with one face always oriented toward the mouse","archived":false,"fork":false,"pushed_at":"2024-08-08T20:59:36.000Z","size":10127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T22:37:17.233Z","etag":null,"topics":["3d","three-js","three-js-example"],"latest_commit_sha":null,"homepage":"https://three-js-tracker-object-mouse.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yousseffdil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T20:50:33.000Z","updated_at":"2024-12-24T12:22:11.000Z","dependencies_parsed_at":"2024-08-08T23:19:34.095Z","dependency_job_id":null,"html_url":"https://github.com/yousseffdil/three-js-tracker-object-mouse","commit_stats":null,"previous_names":["yousseffdil/three-js-tracker-object-mouse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yousseffdil/three-js-tracker-object-mouse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousseffdil%2Fthree-js-tracker-object-mouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousseffdil%2Fthree-js-tracker-object-mouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousseffdil%2Fthree-js-tracker-object-mouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousseffdil%2Fthree-js-tracker-object-mouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yousseffdil","download_url":"https://codeload.github.com/yousseffdil/three-js-tracker-object-mouse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yousseffdil%2Fthree-js-tracker-object-mouse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275020168,"owners_count":25391650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","three-js","three-js-example"],"created_at":"2024-09-24T14:03:06.323Z","updated_at":"2026-02-12T08:31:17.296Z","avatar_url":"https://github.com/yousseffdil.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Three.js Interactive 3D Cube\n\n## Overview\n\nThis project showcases a dynamic 3D scene created with Three.js, featuring an interactive 3D cube that follows the cursor. The cube is textured, projects shadows, and is illuminated by a point light. The background of the canvas is transparent, creating a clean and visually appealing effect.\n\n![Preview](/assets/Preview.gif)\n\n## Features\n\n- **3D Cube**: A textured cube rotates to face the cursor.\n- **Shadows**: The cube casts shadows on a plane beneath it.\n- **Transparent Background**: The canvas background is transparent, making the scene adaptable to various web designs.\n- **Interactive**: The cube responds to mouse movements, enhancing the interactivity of the scene.\n\n## Setup\n\nTo get started with this project, follow these steps:\n\n1. **Clone the Repository**\n\n    ```bash\n    git clone https://github.com/yourusername/threejs-interactive-cube.git\n    cd threejs-interactive-cube\n    ```\n\n2. **Install Dependencies**\n\n    This project uses Three.js from a CDN, so no additional dependencies need to be installed.\n\n3. **Set Up the Project**\n\n    Make sure you have the following files in your project directory:\n    - `index.html`: The main HTML file.\n    - `texture.jpg`: Your texture file. Place it in the correct path (`../texture.jpg`) or update the path in the JavaScript code accordingly.\n\n4. **Run the Project**\n\n    Open `index.html` in your preferred web browser to view the project. You can use a local server for a more robust development environment, such as [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.liveServer) in Visual Studio Code.\n\n## Code Explanation\n\n- **Scene Setup**: Creates a Three.js scene, a camera, and a renderer. The renderer is configured to have a transparent background.\n- **Cube**: A `Mesh` with a `BoxGeometry` and a `MeshStandardMaterial` that has a texture applied. The cube is set to cast shadows.\n- **Lighting**: A `PointLight` is added to illuminate the scene and cast shadows.\n- **Shadow Plane**: A `PlaneGeometry` with `ShadowMaterial` is used to receive shadows from the cube.\n- **Mouse Interaction**: Updates the cube's rotation to face the cursor using mouse coordinates.\n- **Animation Loop**: Continuously updates the scene to render the cube's interaction with the cursor.\n\n## Customization\n\n- **Texture**: Replace `../texture.jpg` with your own texture file.\n- **Lighting**: Adjust the `PointLight` parameters (position, intensity) to suit your scene's needs.\n- **Shadow Plane**: Modify the plane's size and position as needed.\n\n\n## Acknowledgments\n\n- [Three.js](https://threejs.org/) - The JavaScript library used for 3D graphics.\n\n## Contact\n\nFor questions or feedback, please reach out to [fdilyoussef@gmail.com](mailto:fdilyoussef@gmail.com).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyousseffdil%2Fthree-js-tracker-object-mouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyousseffdil%2Fthree-js-tracker-object-mouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyousseffdil%2Fthree-js-tracker-object-mouse/lists"}