This project demonstrates several approaches for displaying 3D objects on the web using different JavaScript libraries and frameworks. It's built with Symfony and provides a simple way to explore various 3D visualization techniques.
-
Multiple 3D Visualization Libraries:
- Google's Model Viewer: Easy, standards-based 3D viewer with AR support
- Three.js: Highly customizable 3D engine with interactive controls
- Babylon.js: Powerful, high-performance 3D engine
-
Framework Integration Examples:
- Vanilla JavaScript implementation
- React integration
- Vue integration
-
Browser-Only Implementation: All dependencies are loaded from CDN, no Node.js required
-
Symfony Backend: Provides routing and template rendering
- PHP 8.4 or higher
- Composer
- Docker and Docker Compose (optional, for containerized environment)
- Web browser with WebGL support
-
Clone the repository:
git clone <repository-url> cd 3d-visualisation
-
Start the Docker containers:
docker compose up -d
Note: The container will automatically run
composer installfor you. This is useful if you don't have PHP installed locally. -
Access the application:
- The application will be available at
http://localhost:8080 - The PHP service runs on port 9000
- The Nginx service serves the application on port 8080
- The application will be available at
-
(Optional) If you need to run Composer commands manually:
docker compose exec php composer [command]For example:
docker compose exec php composer require some/package
-
Clone the repository:
git clone <repository-url> cd 3d-visualisation
-
Install PHP dependencies:
composer install
-
Start the Symfony development server:
symfony server:start
-
Open your browser and navigate to
http://localhost:8080(Docker) orhttp://localhost:8000(Symfony server) -
The homepage displays links to the different 3D visualization demos:
- Model Viewer (Google): Simple, standards-based 3D viewer
- Three.js: Advanced 3D engine with customizable features
- Babylon.js: High-performance 3D engine
-
Click on any of the links to explore the different implementations
src/Controller/: Contains controllers for each 3D visualization methodtemplates/: Contains Twig templates for rendering the 3D modelstemplates/model-viewer/: Google Model Viewer implementationtemplates/tree_js/: Three.js implementationtemplates/babylon_js/: Babylon.js implementation
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT license - see the composer.json file for details.