
如今,大部分代码 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 的编辑器不仅可以直接生成和编辑代码,还能预览代码执行的效果,非常方便。
评论(0)