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

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

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

如今,大部分代码 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 测试 Gemini 桌面版屏幕共享 Live Mode
AI 产品工具
2026年4月16日
0 条评论
小创

Google 测试 Gemini 桌面版屏幕共享 Live Mode

Google 发布 macOS 版原生 Gemini 桌面应用,采用 Swift 语言独立构建,短时间内完成超百项功能特性。开发者发现应用内置尚未激活的 Gemini Live 语音模式和屏幕共享功能,相关设置已就绪,球形悬浮界面清晰可见。 Google 将桌面端定位为“真正具备个性化、主动性的强大助手”,暗示未来数月内将有更多功能发布。随着 Google I/O 2026 大会临近,具备实时语音交互和屏幕共享能力的桌面 Live Mode 将成为其跨平台 AI 战略的重要落子。

#Gemini
阅读全文
Google 在 Gemini 中测试智能体购物原生结账
AI 产品工具
2026年4月16日
0 条评论
小创

Google 在 Gemini 中测试智能体购物原生结账

Google 正为 Gemini 测试内置购物车功能,计划打造集商品浏览、购买、自动化任务于一体的 AI 商业入口。该功能基于年初发布的“通用商务协议”,可支持用户在 Target 、 Gap 等平台直接结账。结合 Chrome 端 Gemini Skills 和智能体浏览功能, Gemini 有望成为一站式 AI 应用,与 ChatGPT 、 Copilot 等展开正面竞争。预计将在 5 月 Google I/O 大会上正式亮相。

#Google#Gemini
阅读全文
Google 为 Mac 推出原生 Gemini 应用
AI 新闻资讯
2026年4月16日
0 条评论
小创

Google 为 Mac 推出原生 Gemini 应用

Google 本周发布 macOS 原生 Gemini 应用,通过快捷键唤起、屏幕共享分析及多模态生成等功能,追赶 OpenAI 与 Anthropic 的桌面端布局。该应用将 AI 从“需要主动打开的工具”转变为“随时待命的协作者”,有望成为桌面端 AI 应用的新标准形态,现已向全球用户开放下载。

#Google#Gemini
阅读全文
互动讨论

评论区

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

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