用 svg 画一幅画,内容为老鼠吃樱桃
- User
用 svg 画一幅画,内容为老鼠吃樱桃
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
用 svg 画一幅画,内容为老鼠吃樱桃
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
多么有趣的请求!下面是一个使用SVG(可缩放矢量图形)绘制的老鼠吃樱桃的图画。我会逐步解释各个部分,但最终你可以直接复制整个代码粘贴到一个 .svg 文件中用浏览器打开查看效果。
首先,我们需要构思一下画面内容:
下面是实现这一切的SVG代码:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
width="400" height="300"
viewBox="0 0 400 300">
<!-- 背景 -->
<rect x="0" y="0" width="400" height="300" fill="#f0f8ff" />
<!-- 地面 -->
<line x1="0" y1="250" x2="400" y2="250" stroke="#8b4513" stroke-width="4" />
<!-- 樱桃 -->
<circle cx="180" cy="120" r="20" fill="#ff1493" />
<circle cx="210" cy="100" r="20" fill="#ff1493" />
<path d="M 195 120 Q 200 90 205 100" stroke="#32cd32" stroke-width="3" fill="none" />
<!-- 叶子 -->
<ellipse cx="220" cy="80" rx="15" ry="10" fill="#32cd32" transform="rotate(-30 220 80)" />
<ellipse cx="190" cy="70" rx="10" ry="8" fill="#32cd32" transform="rotate(40 190 70)" />
<!-- 老鼠 -->
<!-- 身体 -->
<ellipse cx="240" cy="220" rx="30" ry="20" fill="#d3d3d3" />
<!-- 头 -->
<circle cx="200" cy="200" r="20" fill="#d3d3d3" />
<!-- 耳朵 -->
<path d="M 190 185 L 180 170 L 185 190 Z" fill="#d3d3d3" />
<path d="M 210 185 L 220 170 L 215 190 Z" fill="#d3d3d3" />
<!-- 眼睛 -->
<circle cx="190" cy="195" r="3" fill="black" />
<circle cx="210" cy="195" r="3" fill="black" />
<!-- 嘴巴(吃樱桃中) -->
<path d="M 205 205 L 215 208 L 210 212 Z" fill="#ff69b4" />
<!-- 尾巴 -->
<path d="M 270 220 Q 280 240 290 230" stroke="#d3d3d3" stroke-width="8" fill="none" />
<!-- 前爪 -->
<path d="M 200 220 L 185 230 L 195 225 Z" fill="#d3d3d3" />
<!-- 后爪 -->
<path d="M 240 240 L 230 250 L 235 245 Z" fill="#d3d3d3" />
<!-- 咬下的樱桃小块 -->
<circle cx="215" cy="210" r="5" fill="#ff1493" />
<line x1="210" y1="212" x2="205" y2="215" stroke="#ff1493" stroke-width="2" />
</svg>
解释关键部分:
背景和地面:
<rect> 画了一个浅蓝色的背景。<line> 画了一条棕色的线表示地面。樱桃:
<circle> 画出两个樱桃果实。<path> 用贝塞尔曲线(Q指令)画出连接两颗樱桃的绿色果柄。叶子:
<ellipse> 画椭圆,通过 transform="rotate" 旋转角度模拟叶子的自然姿态。老鼠:
<path>)。衔接细节:
怎么使用?
mouse_eat_cherry.svg。效果预览:
尽情欣赏你的 SVG 杰作吧!🎨🍒 如果想改颜色或者加细节,SVG代码中所有 fill 改填充色,stroke 改边框色,非常方便!😊