lottery
🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀
JavaScript★ 4.6k
一个让 THREE 平台化的项目,目前已适配微信,淘宝,头条小程序,微信小游戏
git clone https://github.com/deepkolos/three-platformize.gitdeepkolos/three-platformize一个让 THREE 平台化的项目
后续维护将会在platformize继续
|
云图三维-在线三维CAD设计软件 |
奥本未来-AR/VR领域先行者 |
| 微信 | 淘宝 | 字节 | |
|---|---|---|---|
| 小程序真机 | ✔️ | ✔️ | ✔️ |
| 小程序模拟器 | ✔️ | ✔️ | |
| 小游戏真机 | ✔️ | ||
| 小游戏模拟器 | ✔️ |
奥本未来招聘前端、WebGL、图形学算法,欢迎投简历
注:运行 DEMO 时记得开启调试模式,取消域名验证,使用最新版本微信开发工具打开
具体 Loader 使用方法的 Demo 在这个仓库下three-platformize-demo
|
微信小程序 DEMO 微信小程序基础版 DEMO 微信小游戏 DEMO |
淘宝小程序 DEMO | 字节小程序 DEMO |
|---|---|---|
|
|
|
import * as THREE from 'three-platformize';
import WechatPlatform from 'three-platformize/src/WechatPlatform';
const platform = new WechatPlatform(canvas); // webgl canvas
platform.enableDeviceOrientation('game'); // 开启DeviceOrientation
THREE.PLATFORM.set(platform);
// 使用完毕后释放资源
THREE.PLATFORM.dispose();
// 正常使用three即可
// DEMO 代码示例见 https://github.com/deepkolos/three-platformize-demo
// 基础的使用DEMO见 https://github.com/deepkolos/three-platformize-demo-wechat-simple
// 生产环境时rollup.config.js里请开启teser压缩, 即plugins末尾增加 terser({ output: { comments: false } })
构建时替换平台相关的 api 调用,转发到 PLATFORM 的引用,通过 PLATFORM.set 更新
# 拉取源码 > git clone https://github.com/deepkolos/three-platformize # 安装依赖 > npm i # 更新到最新的three版本 > npm i -S three@latest # 或者指定three版本 > npm i -S three@0.122.0 # 需要把目标three的构建`utils/build/rollup.config.js`同步到本项目的构建`config/rollup.config.three-origin.js` # 建立软链接 > npm run link # 构建 > npm run build # 使用 > npm link # 到使用的项目目录,并链接 > cd your-project > npm link three-platformize # 或者自行发NPM包
# 把自定义Three link 到./three > npx symlink-dir yourthree ./three # 不使用软链接直接复制或者git submodule也可以 > cp yourthree ./three # 复制对应版本three构建配置替换到rollup.config.three-origin.js > cp yourthree/utils/build/rollup.config.js ./config/rollup.config.three-origin.js # 构建 > npm run build
可参考src/WechatPlatform或者src/TaobaoPlatform
class CustomPlatform {
getGlobals() {
// 自定义的polyfill
return {
atob,
Blob,
window,
document,
XMLHttpRequest,
OffscreenCanvas,
HTMLCanvasElement,
createImageBitmap,
};
}
setWebGLExtensions() {
return {
// 可覆盖gl返回值,比如淘宝小程序IOS返回值不为null,但是扩展不可用的bug
EXT_blend_minmax: null,
};
}
dispose() {
// 释放资源
}
}
可通过群里 DeepKolos 联系我
如果项目对您有帮助或者有适配需求,欢迎打赏
感谢各位支持~~
| 时间 | 大佬 |
|---|---|
| 2021/11/10 | 神神 |
| 2021/09/27 | 阿不 |
| 2021/08/10 | 奥本未来 |
| 2021/07/28 | Noth1ng |
| 2021/07/09 | 匿名 |
| 2021/07/07 | 云图 CAD-刘鑫 |
| 2021/06/23 | Fong |
| 2021/06/23 | 刘子弃 |
| 2021/06/23 | Joson |
| 2021/06/03 | 仿生伏尔泰 |
| 2021/04/28 | Noth1ng |
more like this
🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀
🎥🤟 8 minimalistic templates for tfjs mediapipe handpose and facemesh
A repository about starting from scratch for monorepo, fastify, Phaser, colyseus, and threejs.
search projects, people, and tags