UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
University of West Attica · Department of Computer Engineering and Informatics
Computer Graphics
Vasileios Evangelos Athanasiou
Student ID: 19390005
Antonios Kokkinos
Student ID: 20390107
Pantelis Tatsis
Student ID: 20390226
Supervision
Supervisor: Georgios Bardis, Assistant Professor
Athens, July 2024
This project is a pure WebGL (HTML + JavaScript) application and does not require compilation or external build tools.
It runs directly in a modern web browser with WebGL support.
Before running the project, ensure the following requirements are met.
- Modern Web Browser with WebGL enabled:
- Google Chrome
- Mozilla Firefox (recommended)
- Microsoft Edge
- Local HTTP Server (required for texture loading)
Important
Due to browser security restrictions, WebGL cannot load textures correctly when HTML files are opened directly (file://).
A local web server is mandatory.
git clone https://github.com/Computer-Graphics-aka-Uniwa/Table-Chair.gitAlternatively, download the repository as a ZIP archive and extract it locally.
Option 1: Using VS Code Live Server (Recommended)
- Open the project folder in Visual Studio Code
- Install the Live Server extension
- Navigate to:
src/*_scene.html- Right-click the file and select "Open with Live Server"
- The scene you chose will open automatically in your default browser
If Node.js is installed:
npm install -g http-server
cd Table-Chair/src
http-serverOpen the displayed local URL and load the scene you desire.
Camera Controls
-
View Angle
Adjusts the camera’s field of view (degrees) -
Orthogonal Distance
Controls the distance of the camera from the scene center -
Camera Position (Radio Buttons)
Select predefined camera viewpoints around the object -
Redraw
Re-renders the scene with the selected parameters
Interaction Notes
- Scene 1 is static and does not support animation
- No mouse interaction is required
- Camera changes apply immediately after redraw
Camera Controls
-
View Angle
Adjusts the camera’s field of view (degrees) -
Orthogonal Distance
Controls the distance of the camera from the scene center -
Camera Position (Radio Buttons)
Select predefined camera viewpoints -
Redraw
Re-renders the scene with the selected parameters
Interaction Notes
- Scene 2 remains static
- The table and chair are positioned using fixed transformations
- No real-time interaction or animation is present
Camera Controls
-
View Angle
Adjusts the camera’s field of view (degrees) -
Orthogonal Distance
Controls the distance of the camera from the scene center -
Camera Position (Radio Buttons)
Select predefined camera viewpoints -
Redraw
Re-renders the scene with the selected parameters
Interaction Notes
- Scene 3 introduces textured objects but remains static
- No mouse-based interaction is required
- Texture changes are loaded automatically on scene initialization
Camera Controls
-
Mouse Drag Horizontal movement → Rotate camera around the scene Vertical movement → Move camera height (Z-axis)
-
Mouse Wheel Tilt the chair forward and backward (0°–90°)
-
UI Controls View Angle: Adjusts the camera’s field of view (degrees) Orthogonal Distance: Controls camera distance from the scene center Camera Position (Radio Buttons): Select predefined camera viewpoints Redraw: Re-renders the scene with the selected parameters Start / Stop: Enables or disables automatic camera rotation
All textures are located in:
src/textures/Texture characteristics:
- JPEG format
- Power-of-two dimensions (e.g., 512×512)
These constraints ensure:
- Correct mipmap generation
- Prevention of black-texture rendering issues in WebGL
- Ensure the project is served via HTTP, not opened directly as a file.
- Click inside the canvas first to activate mouse focus.
- Verify WebGL is enabled in your browser:
- Chrome:
chrome://gpu - Firefox:
about:support
- Chrome:
- Mozilla Firefox
- No external frameworks were used
- All transformations, animations, textures, and interactions are implemented using:
Raw WebGL APIglMatrix library
The project fully complies with the Computer Graphics course requirements at UNIWA
- Navigate to the
docs/directory - Open the report corresponding to your preferred language:
- English:
3D-Graphics-Scene-using-WebGL.pdf - Greek:
3D-Σκηνή-με-WebGL.pdf
- English:
