The Computer Graphics Project focuses on creating interactive scenes using the Three.js library. The project consists of multiple parts, each addressing different aspects of computer graphics, including scene creation, camera manipulation, materials, lighting, and textures.
This project aims to explore various concepts in computer graphics, including creating interactive scenes, applying materials, setting up lighting, and implementing dynamic features. Each part of the project builds upon the previous one, gradually introducing more complexity and functionality.
The project showcases the following features:
- Scene creation and manipulation
- Camera control and switching
- Material application and shading
- Lighting effects, including dynamic lights
- Texture mapping and interactive objects
- Three.js: JavaScript library for 3D graphics
- HTML/CSS: Web technologies for scene rendering and styling
- JavaScript: Programming language for implementing interactive behaviors
In this part, a simple scene is created with basic elements. The scene includes a fixed camera and interactive chair movement controlled by arrow keys.
This part introduces the concept of a mobile camera and collision detection. The scene includes a field with walls and balls that can move autonomously while avoiding collisions.
Materials, lighting, and shading are explored in this part. The scene includes an airplane composed of different surfaces with distinct materials. A directional light representing the sun and multiple point lights are used to illuminate the scene.
The final part enhances the scene with dynamic lights and textures. A chessboard with textured materials is introduced, along with dynamic spotlights and interactive elements like a billiard ball and a rotating cube.
To run the different parts of the project, follow the instructions below:
- Clone this repository to your local machine.
- Navigate to the respective folder of the part you want to explore.
- Open
index.html
in a web browser. - Use 'A' to toggle wireframe mode.
- Use keys 1-4 to switch between fixed camera views.
- Use arrow keys to move the chair.
- Open
index.html
in a web browser. - Use 'A' to toggle wireframe mode.
- Press 'E' to toggle axis visibility.
- Use keys 1-3 to switch between different camera views.
- Observe autonomous movement of balls and collision avoidance.
- Open
index.html
in a web browser. - Use 'A' to toggle wireframe mode.
- Press 'E' to toggle axis visibility.
- Use keys 1-4 to control point lights.
- Press 'N' to switch between day and night mode.
- Press 'L' to change to basic material.
- Press 'G' to toggle shading mode.
- Start a local server using a terminal command:
python -m http.server
. - Open
http://localhost:8000
in a web browser. - Use 'W' to toggle wireframe mode.
- Press 'D' to toggle directional light.
- Press 'P' to toggle point light.
- Press 'L' to change to basic material.
- Press 'B' to start/stop the billiard ball.
- Press 'S' to pause the scene.
- Press 'R' to reset the scene.
- Use the mouse or touchpad to navigate the scene.