Sack is a web-based showcase for displaying multiple 3D objects in an immersive environment. This project features a universe-like background with floating 3D objects, a story page that visualizes the relationships between objects using an interactive graph, and detailed individual showcases for each object using Google’s <model-viewer>
. It also supports multimedia integration with video, audio, and text annotations.
- Universe-like 3D Scene: View a dynamic background with floating 3D objects created using
three.js
. - Story Page with Interactive Graph: Explore the history of the objects in a visual graph format powered by
D3.js
, with support for multimedia (video, audio, text) behind the story nodes. - 3D Model Viewer: Showcase individual 3D objects using Google's
<model-viewer>
with AR support for mobile devices. - Command-line options: Some command-line options are available for developers to manage configurations and run the project.
To get started with Sack, follow these instructions:
git clone https://github.com/lemorage/sack.git
cd sack
Make sure the setup script has execute permissions, and run it:
chmod +x setup.sh
./setup.sh
You can start the application locally with:
./sack start
By default, the app runs on port 7536
. You can change the port using the command-line options described below.
The project offers a few command-line tools for developers:
start
: Starts the application on port 7536 (or specify a custom port using--port
).generate
: Generates a configuration list for 3D objects. You can batch generate multiple pages using the--batch
option.
For help, run:
./sack --help
.
├── cmd/
│ ├── auto_reload.go
│ ├── config.go
│ ├── handlers.go
│ ├── helpers.go
│ ├── main.go
│ └── middleware.go
├── configs/
│ ├── config.yaml
│ └── graph.json
├── ui/
│ ├── html/
│ │ ├── index.html # Main 3D universe page
│ │ ├── graph.html # Story page with interactive graph
│ │ ├── pages/ # Generated pages for individual objects
│ └── static/ # Assets for the frontend
│ ├── css/ # CSS files
│ ├── img/ # Image files
│ ├── js/ # JavaScript files
│ └── models/ # 3D model files (.glb, .usdz, .webp)
└── setup.sh # Setup script
cmd/
: Contains the Go-based backend server for serving the frontend files.configs/
: Contains configuration files likeconfig.yaml
for page settings andgraph.json
for the story graph.ui/
: Contains all frontend-related code, including HTML, CSS, JavaScript, and 3D models.
This file is used to configure the pages and 3D objects. The format allows you to specify the object details such as model path, poster image, and descriptions.
pages:
page1:
ModelSrcPath: "/static/models/object1.glb"
ModelIosSrcPath: "/static/models/object1.usdz"
PosterPath: "/static/models/object1.webp"
Description: "An ancient artifact found in a remote location."
ModelName: "Artifact1"
DesignerWebsite: "https://designerwebsite.com"
DesignerName: "John Doe"
Defines the story relationships between the 3D objects, including nodes and links for the story graph page.
{
"nodes": [
{
"id": "node1",
"keyword": "Artifact1",
"story": "Discovered in 1920",
"images": ["/static/img1.png"],
"videos": ["/static/video1.mp4"],
"audios": ["/static/audio1.mp3"] },
{
"id": "node2",
"keyword": "Artifact2",
"story": "Unearthed in a tomb",
"images": ["/static/img2.png"],
"videos": ["/static/video2.mp4"],
"audios": ["/static/audio2.mp3"]
}
],
"links": [
{
"source": "node1",
"target": "node2"
}
]
}
Add additional nodes and links as needed to build your story graph.
This project has benefited from the following:
<model-viewer>
for 3D and AR object viewing.three.js
for 3D scene rendering.D3.js
for interactive data visualizations.- Icons by Bharat Icons
The 3D stone object displayed in this project is sourced from Dawanshiju, and is kindly shared by Enza's Research Group.
BSD-3. See LICENSE.