Gemini 3.1 Pro rotates a cube

writes <2% as many bytes as Opus 4.6

Originally published on Greengale

For the latest iteration of my rotating cube SVG series, I had Gemini 3.1 Pro take a crack at it, with the same prompt I gave to Opus 4.6 a while back.

Check out the chat, it also included a nice explanation of the math involved and linked a YouTube video.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" width="100%" height="100%">
  <rect width="400" height="400" fill="#0f172a" />
  
  <defs>
    <filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
      <feGaussianBlur stdDeviation="4" result="blur" />
      <feMerge>
        <feMergeNode in="blur"/>
        <feMergeNode in="SourceGraphic"/>
      </feMerge>
    </filter>
  </defs>

  <g filter="url(#glow)">
    <path fill="none" stroke="#38bdf8" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
      <animate 
        attributeName="d" 
        dur="3s" 
        repeatCount="indefinite" 
        calcMode="linear"
        values="
          M 100 163.4 L 300 163.4 L 300 63.4 L 100 63.4 Z M 100 336.6 L 300 336.6 L 300 236.6 L 100 236.6 Z M 100 163.4 L 100 336.6 M 300 163.4 L 300 336.6 M 300 63.4 L 300 236.6 M 100 63.4 L 100 236.6;
          
          M 69.3 140.5 L 254.1 178.7 L 330.7 86.3 L 145.9 48.1 Z M 69.3 313.7 L 254.1 351.9 L 330.7 259.5 L 145.9 221.3 Z M 69.3 140.5 L 69.3 313.7 M 254.1 178.7 L 254.1 351.9 M 330.7 86.3 L 330.7 259.5 M 145.9 48.1 L 145.9 221.3;
          
          M 58.6 113.4 L 200.0 184.2 L 341.4 113.4 L 200.0 42.6 Z M 58.6 286.6 L 200.0 357.4 L 341.4 286.6 L 200.0 215.8 Z M 58.6 113.4 L 58.6 286.6 M 200.0 184.2 L 200.0 357.4 M 341.4 113.4 L 341.4 286.6 M 200.0 42.6 L 200.0 215.8;
          
          M 69.3 86.3 L 145.9 178.7 L 330.7 140.5 L 254.1 48.1 Z M 69.3 259.5 L 145.9 351.9 L 330.7 313.7 L 254.1 221.3 Z M 69.3 86.3 L 69.3 259.5 M 145.9 178.7 L 145.9 351.9 M 330.7 140.5 L 330.7 313.7 M 254.1 48.1 L 254.1 221.3;
          
          M 100 63.4 L 100 163.4 L 300 163.4 L 300 63.4 Z M 100 236.6 L 100 336.6 L 300 336.6 L 300 236.6 Z M 100 63.4 L 100 236.6 M 100 163.4 L 100 336.6 M 300 163.4 L 300 336.6 M 300 63.4 L 300 236.6
        " />
    </path>
  </g>
</svg>

Notably, this simple, orthographic projection is just 1,860 characters, compared to Opus 4.6's perspective projection with gradients, vertex dots, and the cube tilted relative to its rotation axis, which was a 165,141 charcter SVG. They both still did the unprompted glow effect, which everyone loves.