太阳系模拟器
太阳系模拟器
Prompt Content
Copy and paste directly into your model or internal evaluation tool.
请生成一个独立的HTML文件,其中包含一个可交互的太阳系模拟器。
所有代码应包含在 <html> 文件内,不要引用外部库或文件。
该模拟器应具备以下功能:
视觉与场景
- 背景:深色背景,模拟宇宙空间。
- 恒星:中心应有一个发光的大型黄色球体代表太阳。
- 行星:围绕太阳绘制八颗主要的行星(水星、金星、地球、火星、木星、土星、天王星、海王星),每颗行星的颜色和相对大小应有视觉区分度。土星应有环。
- 轨道:为每颗行星绘制椭圆(或圆形)轨道,以同心圆或接近同心圆的形式环绕太阳,清晰地显示它们的运动路径。
- 标题:页面顶部中央显示“Solar System Simulation”标题。
模拟功能
- 行星运动:
- 所有行星应以各自的速度沿其轨道围绕太阳公转。
- 行星的公转速度应与其实际太阳系中的相对速度成比例,越靠近太阳的行星移动越快。
- 初始状态:加载时,行星应处于其预设的初始位置,并可能处于暂停状态或以默认速度开始运行。
交互与控制面板
- 控制面板:在模拟区域下方有一个水平布局的控制面板,包含以下交互元素:
- “Start”按钮:点击后开始或恢复模拟。
- “Pause”按钮:点击后暂停模拟。
- “Reset”按钮:点击后将所有行星重置到其初始位置和默认速度。
- “Speed”滑块:一个滑块控件,允许用户调整模拟的速度,范围从慢速到快速(例如,从1倍速到5倍速,并显示当前的倍数)。
技术考量
- 使用HTML作为基本结构。
- 使用CSS进行基本布局、背景、按钮和行星的样式设置。
- 核心模拟功能必须使用JavaScript实现,包括:
- 绘制太阳、行星和轨道(推荐使用
<canvas>元素进行绘制)。 - 计算行星的实时位置以模拟公转。
- 处理“Start”、“Pause”、“Reset”按钮的点击事件。
- 根据“Speed”滑块的值调整模拟的帧率或步长。
- 绘制太阳、行星和轨道(推荐使用
- 确保动画流畅,行星运动轨迹平滑。
Use Cases
Reference Output
No standard answer available; manual review by scoring dimensions is recommended.
Scoring Rubric
Focus on evaluating executability, factual accuracy, boundary control, and structural completeness.
Try & save
Fill variables and copy, or save as a personal template.
This template has no variables and is ready to copy.
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
MQL5 Flexible Trade Management Pro
Design a powerful MQL5 code for flexible trade management on the chart, capturing profits and eliminating losing trades with precise calculations to protect the account.
Surprise Point-and-Click Game Generator
Ask the model to design or implement a point-and-click game based on AI choices and make the result surprising.
Building an AI to Beat Pro Players in Yu-Gi-Oh
Building an AI that learns a specific deck in Yu-Gi-Oh Master Duel and beats pro players using ygo agent and Kaggle Notebooks.
Build ESP32 UI Library
Design and implement an efficient UI library for the ESP32 microcontroller, including graphics rendering and user interaction.