如何通过 Gemini 2.5 Pro 实现 3D 应用程序的氛围编程

Gemini 2.5 Pro 内置编辑器支持“氛围编程”:上传蛋糕图片后,用自然语言指令即可生成可交互的 Three.js 3D 蛋糕可视化应用,实时调整颜色、装饰、层数、动画,并同步更新价格估算,所有修改即时预览。

发布于2025年4月30日 08:17
编辑零重力瓦力
评论0
阅读55

如今,大部分代码 IDE 都支持氛围编程(vibe coding)。实际上,如果应用程序的规模不大,完全可以直接使用模型自带的编辑器来操作。比如,可以在 Gemini 2.5 Pro 的内置编辑器中,通过自然语言指令沉浸式地开发一个基于 three.js 的 3D 蛋糕制作应用。

以下是您提供的内容,经过格式整理和翻译后的版本。每段均为英文在上,中文在下 ,方便对照阅读。

🟦 初始要求

上传一张蛋糕的图片,然后输入以下提示语

Based on this design, can you create a 3D interactive cake visualizer in three.js that is configurable?
根据这个设计,你能用 Three.js 创建一个可配置的 3D 交互蛋糕可视化工具吗?

I want to be able to change things like:
我希望可以更改以下内容:

1. color of the cake
蛋糕的颜色

2. the color of the flowers
花朵的颜色

3. the topper of the cake (nothing, star, sphere)
蛋糕顶部装饰(无、星星、球形)

4. whether there is pearl ribbing along the outside of the cake or not
蛋糕外部是否有珠状滚边装饰

5. the placement of the flowers on the cake.
蛋糕上花朵的位置摆放

6. As these things are selected, there should be a price estimator that changes as different options are selected.
当这些选项被选择时,应该有一个价格预估器会随着不同选项的更改而变化。

Also, as the user changes something in the menu, instead of the cake just switching instantly, make it animate! Show the cake layers stacking up quickly, and then have the decorations appear one by one, starting from the bottom. The animation should be pretty quick, and the user should still be able to spin the cake around while it's happening.
此外,当用户在菜单中更改某些内容时,不要让蛋糕立刻切换状态,而是添加动画效果!展示蛋糕层快速堆叠起来的过程,然后从底部开始依次出现装饰。动画应较为迅速,同时用户在动画进行时仍能旋转蛋糕查看各个角度。

🔴 第一次修改

Make sure that the cake color actually changes as I go, and make sure that there are actual flowers. Currently there are none.
请确保当我进行操作时,蛋糕颜色确实会发生变化,并且确保真的有花朵出现。目前还没有花朵。

🟡 第二次修改

Make the cake topper better. Currently it is super small and it needs to be scaled appropriately.
请优化蛋糕顶部装饰。当前太小了,需要适当调整大小。

🟢 第三次修改

1. Make sure the cake topper is sitting on top of the cake.
确保蛋糕顶部装饰确实位于蛋糕顶部。

2. Make the amount of cake layers customizable.
让蛋糕层数可以自定义。

3. Change the estimated price by lowering it by 50% overall.
将整体的价格预估降低 50%。

🔵 第四次修改

The cake topper isn't appearing any more. Make sure it appears on the top of the cake.
蛋糕顶部装饰现在不显示了,请确保它出现在蛋糕顶部。

Gemini 的编辑器不仅可以直接生成和编辑代码,还能预览代码执行的效果,非常方便。

相关文章

Google 为何要开发 Gemma 4 模型
AI 产品工具
2026年7月11日
0 条评论
小创

Google 为何要开发 Gemma 4 模型

谷歌推出开源模型 Gemma 4,旨在解决网络受限地区无法使用前沿 AI 的问题。该模型追求内存占用下的智能最大化,首次具备多模态与智能体能力,支持在无网移动端高效运行复杂任务。目前已在乌干达离线医疗系统及秘鲁原住民语言保护等场景中落地应用。通过将大模型蒸馏至终端设备,Gemma 4 摆脱了对云端算力的依赖,推动去中心化开源生态发展,赋能各社区按需构建专属系统。

#开源模型#Google#Gemma
阅读全文
一个人用 Claude 把 53 万行 Zig 重写成 Rust
AI 编程开发
2026年7月11日
0 条评论
零重力瓦力

一个人用 Claude 把 53 万行 Zig 重写成 Rust

Bun 开发者利用 Claude Fable 5 在 11 天内将 53.5 万行 Zig 代码重写为 Rust,以解决内存安全问题。项目采用 64 个 AI 实例并行及对抗性审查机制,耗资约 16.5 万美元。重写后二进制体积缩减 20%,性能提升 2% 至 5%。尽管存在 1.3 万个 unsafe 块和 19 个回归问题引发争议,但该项目验证了 AI 辅助大规模重构的可行性,其分离上下文与对抗审查等方法论具有重要参考价值。

#Claude Code#AI 编程
阅读全文
Claude 自己开机器狗:比人快20 倍,代码量只有十分之一
访谈案例
2026年6月21日
0 条评论
零重力瓦力

Claude 自己开机器狗:比人快20 倍,代码量只有十分之一

Anthropic 实验显示,Claude Opus 4.7 已能全程自主控制机器狗完成任务,速度比人类快约 20 倍,代码量仅为其十分之一。这标志着 AI 智能体正从辅助编程迈向物理工具自主操作阶段。但模型在实时闭环精细控制上仍有局限,且当前成果基于低复杂度任务。该进展体现了通用模型 scaling 的副产物效应,预示物理智能体时代早期来临,但距离解决复杂真实场景仍有差距。

#Claude#AI 编程
阅读全文
互动讨论

评论区

围绕《如何通过 Gemini 2.5 Pro 实现 3D 应用程序的氛围编程》展开交流,未登录用户可浏览评论,登录后可参与讨论。

评论数
0
登录后参与评论
支持发表观点与回复一级评论,互动后将同步到消息中心。
登录后评论
暂无评论,欢迎成为第一个参与讨论的人。