Three-platformize 一个支持多小程序平台的THREE (已适配微信小程序和淘宝小程序)
发布于 3 年前 作者 gang56 1862 次浏览 来自 分享

虽然微信官方提供了一个适配方案,但是并不完美,尤其是在工程上面。可轻松实现web和小程序代码复用

所以针对性优化了已下支持

  1. 支持__TS类型提示__,能方便查阅API文档(d.ts)
  2. 可以通过构建修改方便使用 three 生态 npm 包,无需手动 scope,比如 GLTFLoader
  3. 支持 tree shaking 能减少多点就少点,加个 tfjs 就更加头大。
  4. 有资源释放 dispose 接口。
  5. 支持方便动态注入多个小程序平台的平台接口实现适配器,多 backends 。

在努力适配中,目前已适配和测试过以下模块

Loader

  1. GLTFLoader
  2. TextureLoader
  3. RGBELoader & PMREMGenerator
  4. SVGLoader

Controls

  1. OrbitControls & MapControls
  2. DeviceOrientationControls

项目地址 https://github.com/deepkolos/three-platformize

DEMO地址 https://github.com/deepkolos/three-platformize-demo-wechat

1 回复

1.0.5 (2021-01-27)

Bug Fixes

  • meshopt location at examples/jsm/libs (4cda31b)
  • update npmignore (936eac9)

Features

  • add meshopt & doc update & fix ownerDocument (a6368e5)
  • add TextDecoder polyfill & EXRLoader works (25ff7c7)
回到顶部