quickstart
Quickstart
Quickstart
This guide walks you through creating and running your first physics simulation on PHYS.RUN.
Prerequisites
- A modern browser (Chrome 113+, Firefox 114+, Safari 17+).
- A PHYS.RUN account (sign up here).
Step 1: Create a Codex
A Codex is a simulation definition. Navigate to your Dashboard and click New Codex.
Choose a template to start from:
| Template | Description |
|---|---|
| Blank Canvas | Empty 2D workspace |
| Projectile Motion | Classic parabolic trajectory |
| Pendulum | Simple harmonic oscillator |
| N-Body | Gravitational N-body system |
Step 2: Define Entities
Entities are the objects in your simulation. Each entity has a type, position, and physical properties:
{
"type": "circle",
"position": [0, 5],
"radius": 0.5,
"mass": 1.0,
"velocity": [2, 0],
"material": {
"restitution": 0.8,
"friction": 0.3
}
}
Step 3: Run the Simulation
Press Play or use the keyboard shortcut Space. The Director will:
- Initialize the physics world from your Codex.
- Step the simulation at a fixed timestep (default: 1/60s).
- Render each frame using your selected renderer.
Step 4: Share
Every Codex gets a unique URL. Share it with collaborators or embed it in your website:
<iframe src="https://phys.run/sim/my-simulation" width="800" height="600"></iframe>
What's Next?
- Read the API Overview for the full Codex schema reference.
- Explore the Codex Registry for community-built simulations.