refactor(wish-tree): 用 WebGL 重写许愿树
Publish Mini Program Dev Version / publish (push) Successful in 4m10s
Publish Mini Program Dev Version / publish (push) Successful in 4m10s
- 移除 Canvas 2D 绘制,改用 WebGL - 手写着色器实现光照和发光效果 - 树干使用圆柱体变形,带扭曲效果 - 树冠使用多层变形球体,带噪声 - 相机自动旋转,可触摸控制 - 保留陀螺仪和麦克风交互 - 简化场景,只保留一棵祈福树 - 深色主题 UI,金色点缀
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
<view class="container">
|
||||
<!-- 全屏画布 -->
|
||||
<!-- WebGL Canvas -->
|
||||
<canvas
|
||||
canvas-id="wishTree"
|
||||
class="wish-tree-canvas"
|
||||
style="width: {{canvasWidth}}px; height: {{canvasHeight}}px;"
|
||||
type="webgl"
|
||||
id="webgl-canvas"
|
||||
class="webgl-canvas"
|
||||
bindtouchstart="onCanvasTouch"
|
||||
bindtouchmove="onCanvasMove"
|
||||
bindtouchend="onCanvasEnd"
|
||||
></canvas>
|
||||
|
||||
<!-- 顶部导航 -->
|
||||
<view class="top-bar">
|
||||
<view class="tree-switcher">
|
||||
<view class="switch-btn" bindtap="switchTree" data-direction="prev">
|
||||
<text class="switch-icon">‹</text>
|
||||
</view>
|
||||
<view class="tree-name">{{trees.length > 0 ? trees[currentTreeIndex].name : '许愿树'}}</view>
|
||||
<view class="switch-btn" bindtap="switchTree" data-direction="next">
|
||||
<text class="switch-icon">›</text>
|
||||
</view>
|
||||
<view class="tree-info">
|
||||
<text class="tree-name">{{treeName}}</text>
|
||||
<text class="tree-desc">{{treeDesc}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 传感器控制 -->
|
||||
|
||||
Reference in New Issue
Block a user