ExploreWorkspaceAbout

quickstart

Quickstart

.md

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:

TemplateDescription
Blank CanvasEmpty 2D workspace
Projectile MotionClassic parabolic trajectory
PendulumSimple harmonic oscillator
N-BodyGravitational 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:

  1. Initialize the physics world from your Codex.
  2. Step the simulation at a fixed timestep (default: 1/60s).
  3. 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?