multipleWindow3dScene README

The project's README from github.com/bgstaal/multipleWindow3dScene. As one markdown file: README.md.

Multiple Window 3D Scene using Three.js

Introduction

This project demonstrates a unique approach to creating and managing a 3D scene across multiple browser windows using Three.js and localStorage. It's designed for developers interested in advanced web graphics and window management techniques.

Features

Installation

Clone the repository and open index.html in your browser to start exploring the 3D scene.

git clone https://github.com/bgstaal/multipleWindow3dScene

Usage

The main application logic is contained within main.js and WindowManager.js. The 3D scene is rendered in index.html, which serves as the entry point of the application.

Structure and Components

Detailed Functionality

Contributing

Contributions to enhance or expand the project are welcome. Feel free to fork the repository, make changes, and submit pull requests.

License

This project is open-sourced under the MIT License.

Acknowledgments

Contact

For more information and updates, follow @nonfigurativ on Twitter.

multipleWindow3dScene (bgstaal/multipleWindow3dScene)

Searching Database…

这是什么?这是一个小型演示,展示如何在多个独立的浏览器窗口之间,让同一个 3D 场景在视觉上保持连续。它使用 Three.js 进行渲染,并用 localStorage 同步窗口位置和状态。
这是一个库,还是只是一个演示页面?它是一个普通的静态演示,由几个 JS 文件组成,不是打包好的库或框架。没有构建步骤,也没有 npm 包,只有 HTML 和脚本。
我该怎么运行它?克隆仓库,然后直接在浏览器中打开 index.html。再在新窗口中打开它,就能看到共享场景的同步效果。
我需要先安装 Node、npm 或构建工具吗?不需要。它直接内置了压缩版的 Three.js(three.r124.min.js),因此无需安装或构建任何东西。
窗口同步到底是怎么实现的?有没有需要注意的地方?同步完全依赖同一浏览器、同源下各窗口之间的 localStorage 事件,由 WindowManager.js 管理。它无法跨不同浏览器或设备同步。直接打开文件(file://)时,根据浏览器的不同,可能会遇到 localStorage 或 CORS 相关的问题。
我应该重点看哪些文件,才能理解其中的逻辑?main.js 负责初始化 Three.js 场景,并处理窗口和尺寸变化事件。WindowManager.js 负责跨窗口的生命周期,以及基于 localStorage 的状态同步。index.html 只是把它们连接在一起。
它使用的是哪个版本的 Three.js?它附带的是打包好的压缩版本 three.r124.min.js,而不是从 CDN 或包管理器中拉取该库。
我移动或调整浏览器窗口大小后,还能看到共享场景吗?可以,这正是核心功能。WindowManager.js 通过 localStorage 记录每个窗口的位置和状态,因此你移动或调整窗口时,3D 场景也会保持一致的响应。
Creator
bgstaal
Size
0.2 MB
Stars
18.9K
Updated
CommitNov 27
Age
2y
Commits · 90 Days