Joints in R3 with your AI: hinges, sliders and welds

Ask your AI for joints in R3: a pendulum, a hinge that stops at 45 degrees, a motor, a slider on a rail and a weld. The exact words to ask, and the R3 calls it makes.

How-to video (69 s)

A title card reads "How to make joints with your AI". Split screen. Left, a chat panel: the request, pasted, asking R3 to show how joints work with a pendulum, a hinge that swings 45 degrees each way, an arm a motor turns, a block on a slanted rail and a block welded at an angle, and, line by line, the R3 tool calls Claude makes: R3's guides, a new project, a floor, five hooks, the moving parts, their colliders, five joints, a run of physics in the editor with position checks, a help page and a preview link, then Claude's answer. Right, the R3 editor: the hooks and parts appear, then swing, turn and slide. Then the preview link opens and Start is pressed: the parts move on their joints. An AI voice narrates. End card: r3js.org.

Transcript

0:02 With R3 connected, ask Claude to show you how joints work. A pendulum, a hinge, a motor, a slider, and a weld.

0:14 Claude reads R3's joints how-to, and makes a new project, with a floor, and a fixed hook for each joint.

0:25 It makes each hook a fixed body, and adds the parts that move. A weight, an arm, and two blocks.

0:35 Then the joints. Three hinges, free, limited to 45 degrees, and turned by a motor. A slider on a slanted rail. And a weld.

0:48 It runs physics in your editor, and reads where each part is, to check that it moves as it should.

0:55 It writes a help page, and gives you a link to try it.

1:00 Open the link, and press Start. Each joint moves its own way.

Watch with transcript

You can build joints by hand in the Inspector (Joints in R3, by hand), or ask your AI to do the typing. This page gives you the words to ask, and shows what the AI does in R3 when you ask them, so you can follow along and check its work.

You need an AI connected to R3: Claude, or another app that speaks MCP. How to connect Claude to R3 takes a minute. Keep R3 open in a browser tab, signed in: the AI shows its work there, and can start physics in that tab to check it.

What a joint is, in one paragraph

A joint connects two physics bodies and decides how they may move against each other: a Joint Revolute is a hinge (it turns around one line, the axis), a Joint Prismatic is a rail (it slides along one line), a Joint Fixed is a weld (no movement at all) and a Joint Spherical is a ball joint. Each joint names its two bodies (body1, body2) and the point where they meet, measured once from each body's centre (anchor1, anchor2). The by-hand page explains each word; your AI reads the same in R3's how-to HOWTO_JOINTS.md and the API reference.

1. Ask for all of them at once

Paste this into your AI, word for word:

> In R3, show me how joints work. On a floor, side by side: a weight swinging like a pendulum from a fixed hook; a hinge that only swings 45 degrees each way; an arm that a motor turns round and round; a block that slides down a slanted rail and stops; and a block welded to a hook at an angle. Start physics to check that each one moves as it should, then give me a link to try it.

We gave exactly this to Claude (Claude Code, connected to R3) on 2026-11-05 and let it work on its own. The video at the top of this page replays that run, call by call. In about 50 R3 calls it:

  1. Read R3's guides first: r3_docs_read for PHYSICS_USAGE.md and the joints how-to HOWTO_JOINTS.md. An AI has never seen R3 before; the guides are how it learns the right names and units.
  2. Made a project (r3_project_create) with a floor (r3_factory_run Physics Plane), five small dark cubes as hooks (r3_factory_run Cube), and made each hook a fixed body (r3_component_add RigidBody Fixed and Collider Cuboid).
  3. Added the moving parts with r3_factory_run Physics Cube: an orange weight, a yellow weight, a long blue arm, a green block, and a purple block tilted 45 degrees.
  4. Added the five joints with r3_component_add. These are its calls (only the project id and the anchors it set to 0, 0, 0 left out):
r3_component_add {"type": "JointRevolute", "values": {"name": "Pendulum joint", "body1": "hook_pendulum_body", "body2": "pendulum_weight_rigid_body", "anchor1": {"x": 0, "y": 0, "z": 0}, "anchor2": {"x": -2, "y": 0, "z": 0}, "axis": {"x": 0, "y": 0, "z": 1}}}
r3_component_add {"type": "JointRevolute", "values": {"name": "Hinge joint", "body1": "hook_hinge_body", "body2": "hinge_weight_rigid_body", "anchor2": {"x": 0, "y": 2, "z": 0}, "axis": {"x": 0, "y": 0, "z": 1}, "limitsEnabled": true, "limitsMin": -0.785, "limitsMax": 0.785}}
r3_component_add {"type": "JointRevolute", "values": {"name": "Motor joint", "body1": "hook_motor_body", "body2": "motor_arm_rigid_body", "anchor2": {"x": 0, "y": 0, "z": -0.5}, "axis": {"x": 0, "y": 0, "z": 1}, "motorEnabled": true, "motorTargetVelocity": 2, "motorMaxForce": 1000}}
r3_component_add {"type": "JointPrismatic", "values": {"name": "Slider joint", "body1": "hook_slider_body", "body2": "slider_block_rigid_body", "anchor2": {"x": -0.7071, "y": 0.7071, "z": 0}, "axis": {"x": 0.7071, "y": -0.7071, "z": 0}, "limitsEnabled": true, "limitsMin": -0.2, "limitsMax": 1.5}}
r3_component_add {"type": "JointFixed", "values": {"name": "Weld joint", "body1": "hook_weld_body", "body2": "welded_block_rigid_body", "anchor1": {"x": 0.3, "y": 0, "z": 0}, "anchor2": {"x": -0.5657, "y": 0.5657, "z": 0}}}

The hinge's weight hangs straight down under its hook, so it gave it a sideways push (r3_component_set its rigid body's linearVelocity X = 6) to show the 45-degree stops.

  1. Checked its work in the open R3 tab: r3_editor_open, r3_editor_run (physics on), r3_editor_inspect (where is each part now?), r3_editor_capture (a picture of the canvas), and r3_editor_stop.
  2. Wrote a help page (r3_help_write, shown behind the project's "?" button) and made a preview link (r3_preview_create).

Its answer listed what each joint does and what it measured. We checked the same project ourselves in R3's engine: the pendulum stays 2.00 m from its hook and swings over to the other side; the pushed hinge stops at 44.5 degrees each way; the arm turns round its hook; the block slides exactly 1.5 m along its rail without turning; the welded block keeps its 45-degree tilt. The preview link shows a Start button, and all five move when it is pressed.

Your AI will not make exactly the same calls: it chooses its own names, sizes and colours. What should be the same is the shape: read the guides, build, check in the editor, give you a link.

2. Or one joint at a time

Smaller requests work too, one after another, in the same project. Each line below is what to ask; under it is the R3 call the AI makes (checked on R3 on 2026-11-05, with a fixed hook made of a small Cube with a RigidBody Fixed and a Collider Cuboid, and a Physics Cube two metres to its right).

A pendulum. "Hang the cube from the hook with a hinge, so it swings left and right like a pendulum."

r3_component_add {"type": "JointRevolute", "values": {"body1": "rigid_body_fixed_1", "body2": "rigidbody_physics_cube_1", "anchor2": {"x": -2, "y": 0, "z": 0}, "axis": {"x": 0, "y": 0, "z": 1}}}

The pivot is the hook's centre (anchor1 stays 0, 0, 0); seen from the cube it is two metres to the left (anchor2). The axis (0, 0, 1) points at you, so it swings on the screen. Measured: the cube stays 2.000 m from the hook and swings down and up the other side.

A hinge that stops. "Make the hinge stop at 45 degrees each way."

r3_component_set {"entityRef": "joint_revolute_1", "properties": {"limitsEnabled": true, "limitsMin": -0.785, "limitsMax": 0.785}}

Angles are in radians (45 degrees = 0.785), counted from where the cube is when physics starts. Measured: it swings down to exactly 45 degrees and stops.

A motor. "Take the limits off and turn it round with a motor at 3 radians a second."

r3_component_set {"entityRef": "joint_revolute_1", "properties": {"limitsEnabled": false, "motorEnabled": true, "motorTargetVelocity": 3}}

motorMaxForce (default 1000) is how hard the motor may push. Measured: about 170 degrees a second, over the top, round and round.

A slider. "Put the cube on a rail that goes down and to the right at 45 degrees, and let it slide 1.5 metres."

r3_component_add {"type": "JointPrismatic", "values": {"body1": "rigid_body_fixed_1", "body2": "rigidbody_physics_cube_1", "anchor1": {"x": 2, "y": 0, "z": 0}, "axis": {"x": 0.7071, "y": -0.7071, "z": 0}, "limitsEnabled": true, "limitsMin": 0, "limitsMax": 1.5}}

The rail passes through the cube's centre (anchor1 is that point seen from the hook, anchor2 stays 0, 0, 0), the axis is the rail's direction, and the limits are in metres. Measured: it slides exactly 1.5 m along the rail, without turning or leaving the line.

A weld. "Tilt the cube 30 degrees and weld it to the hook where it is."

r3_component_set {"entityRef": "mesh_physics_cube_1", "properties": {"position": {"x": 1.2, "y": 4, "z": 0}, "rotation": {"x": 0, "y": 0, "z": 0.5236}}}
r3_component_add {"type": "JointFixed", "values": {"body1": "rigid_body_fixed_1", "body2": "rigidbody_physics_cube_1", "anchor1": {"x": 1.2, "y": 0, "z": 0}}}

Over MCP and in code, rotations are in radians (30 degrees = 0.5236); the Inspector shows degrees. Measured: the cube hangs at the hook, still tilted exactly 30 degrees.

Check it. "Start physics and check that it moves the way it should." The AI calls r3_editor_run (it brings the project to the front of your tab and starts physics), reads the moving cube's position a few times with r3_editor_inspect, may look at the canvas with r3_editor_capture, and stops with r3_editor_stop, which puts everything back where it started.

Share it. "Give me a link to try it." r3_preview_create makes a private link for 7 days; the page has a Start button that runs the physics.

(In each call above the AI also passes the project's id; it is left out here to keep the lines short.)

Good to know

Every option of each joint is in the API reference: open it, then Joint Revolute, Joint Prismatic, Joint Fixed or Joint Spherical.

All R3 tutorials