One commited on
Commit
157f8ab
·
verified ·
1 Parent(s): 4cc5b6b

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +9 -4
index.html CHANGED
@@ -634,7 +634,7 @@ class Fish {
634
  // v24: Ecco-style blend factor (0 = side profile, 1 = seen from above/below).
635
  // Flattens the tail lobes and spreads eyes/barbels as we see more of the back.
636
  const ev = Math.max(0, Math.min(1, this.viewAngle));
637
- const tailFlat = 1 - 0.4 * ev; // extra foreshortening for the caudal lobes only
638
 
639
  // tail fin (v7 rounded / v11 three styles): each tip is swept around by a curve
640
  // whose control point sits just past where the old spike was. The style is fixed
@@ -822,10 +822,15 @@ class Fish {
822
  // never disconnects as the back undulates (v4)
823
  // v17: matches the fish's own color instead of a fixed blue — silver fish no longer
824
  // sprout mismatched blue fins
 
 
825
  c.fillStyle = this.dorsalFillStyle;
826
  c.beginPath();
827
- c.moveTo(-s * 0.15, -s * 0.36 + wy(-s * 0.15));
828
- c.quadraticCurveTo(s * 0.05, -s * 0.78 + wy(s * 0.05), s * 0.38, -s * 0.4 + wy(s * 0.38));
 
 
 
829
  c.closePath();
830
  c.fill();
831
 
@@ -2553,7 +2558,7 @@ function buildCausticTile() {
2553
  const c = causticTile.getContext("2d");
2554
 
2555
  // Apply blur to make caustics look softer/more realistic
2556
- c.filter = "blur(4px)"; // v26: tighter blur so the pattern reads clearly
2557
 
2558
  // Draw a few random bright spots/lines that look like refracted light patterns
2559
  for (let i = 0; i < 18; i++) {
 
634
  // v24: Ecco-style blend factor (0 = side profile, 1 = seen from above/below).
635
  // Flattens the tail lobes and spreads eyes/barbels as we see more of the back.
636
  const ev = Math.max(0, Math.min(1, this.viewAngle));
637
+ const tailFlat = 1 - 0.55 * ev; // v25: squish the tail fin a bit more when vertical
638
 
639
  // tail fin (v7 rounded / v11 three styles): each tip is swept around by a curve
640
  // whose control point sits just past where the old spike was. The style is fixed
 
822
  // never disconnects as the back undulates (v4)
823
  // v17: matches the fish's own color instead of a fixed blue — silver fish no longer
824
  // sprout mismatched blue fins
825
+ // v25: as the fish turns to swim vertically (ev→1), the dorsal fin slides from
826
+ // "on top of the fish" to "in the middle" (centerline), matching the top-down view
827
  c.fillStyle = this.dorsalFillStyle;
828
  c.beginPath();
829
+ const dorsalBaseY1 = -s * 0.36 * (1 - 0.6 * ev); // base point 1 moves toward centerline
830
+ const dorsalPeakY = -s * 0.78 * (1 - ev); // peak moves to centerline (y=0)
831
+ const dorsalBaseY2 = -s * 0.4 * (1 - 0.6 * ev); // base point 2 moves toward centerline
832
+ c.moveTo(-s * 0.15, dorsalBaseY1 + wy(-s * 0.15));
833
+ c.quadraticCurveTo(s * 0.05, dorsalPeakY + wy(s * 0.05), s * 0.38, dorsalBaseY2 + wy(s * 0.38));
834
  c.closePath();
835
  c.fill();
836
 
 
2558
  const c = causticTile.getContext("2d");
2559
 
2560
  // Apply blur to make caustics look softer/more realistic
2561
+ c.filter = "blur(6px)"; // v27: softer blur, more realistic caustics
2562
 
2563
  // Draw a few random bright spots/lines that look like refracted light patterns
2564
  for (let i = 0; i < 18; i++) {