BUILDING 3D
MEDICAL SIMULATIONS
Build a walk-through 3D operating room that runs in any browser: load a compressed GLB model, walk it in first person with WASD and the mouse, bump into real equipment, and use a live patient monitor, a defibrillator and a surgical table that actually respond.
New in Part 2: an interactive 3D anatomy quiz. Tap any of 263 bones of a real skeleton to learn its name, then take the Bone Quest quiz. Play it below, or tap the patient on the operating table.
By Shane Brumback · Updated November 14, 2026 · about 16 minute read
IFS MEDSIM 3D ANATOMY GAMES
9 free anatomy games built with Three.js and Z-Anatomy models, one for each body system. Tap any part to learn its name, then take the quiz. Click the patient on the table to open the hub.
-
Skeletal System 3D Anatomy Quiz
Tap any of 263 bones of a real skeleton to learn its name, show or hide body regions, then take the 12-question Bone Quest quiz.
-
Cardiovascular System 3D Anatomy Quiz
Tap any of 669 heart parts and blood vessels on a real 3D model to learn their names, show or hide body regions, then take the 12-question Pulse Quest quiz.
-
Lymphatic System 3D Anatomy Quiz
Tap any of 159 lymph nodes and lymphoid organs on a real 3D model to learn their names, show or hide body regions, then take the 12-question Node Quest quiz.
-
Muscular System 3D Anatomy Quiz
Tap any of 483 muscles on a real 3D model to learn their names, show or hide body regions, then take the 12-question Muscle Quest quiz.
-
Joints & Ligaments 3D Anatomy Quiz
Tap any of 413 ligaments, discs and joint parts on a real 3D model to learn their names, show or hide body regions, then take the 12-question Joint Quest quiz.
-
Brain 3D Anatomy Quiz
Tap any of 236 brain structures on a real 3D model to learn their names, show or hide body regions, then take the 12-question Brain Quest quiz.
-
Nervous System 3D Anatomy Quiz
Tap any of 314 nerves, spinal cord parts and eye parts on a real 3D model to learn their names, show or hide body regions, then take the 12-question Nerve Quest quiz.
-
Digestive System 3D Anatomy Quiz
Tap any of 37 digestive organs and parts on a real 3D model to learn their names, show or hide body regions, then take the 12-question Gut Quest quiz.
-
Respiratory System 3D Anatomy Quiz
Tap any of 39 lung lobes and airways on a real 3D model to learn their names, show or hide body regions, then take the 12-question Breath Quest quiz.
LIVE DEMO
The operating room on the right of this page is the live scene on a slow tour. Launch the full-screen demo, press Click to walk, then use WASD or the arrow keys and the mouse. Hover equipment to learn what it does; click to use it. Launch asks for a free Google sign-in first. Press Esc or Exit to return.
Free Google sign-in · Click to walk · WASD / arrows + mouse · Esc to exit
Introduction
Medical training has a problem: real operating rooms are expensive, busy and full of patients. Simulation lets students practice the layout, the equipment and the emergency steps before they ever walk into one. Studies of simulation-based medical education consistently find better skills and confidence than lectures alone, and much of that benefit comes from repetition and immediate feedback, two things software is great at.
Three.js lets you deliver that simulation as a web page. No install, no app store, no special hardware: a student opens a link on a school laptop and is standing in the room. In this tutorial you build exactly that: a first-person walkthrough of an operating room with collision, plus an interaction layer where the patient monitor shows a live ECG, you can trigger ventricular fibrillation and shock it back with the defibrillator, raise the table and change an IV drip rate.
BUILDING MORE 3D LEARNING WORLDS?
Read Creating 3D Virtual Educational Worlds with Three.js: the five core systems behind interactive 3D learning worlds, a step-by-step build, and a solar system case study.
Read the Educational Worlds ArticleWhat Makes a Good Training Simulation
- Correct scale: build in real meters so eye height (1.6 m), table height and walking speed feel right. Wrong scale is the first thing clinicians notice.
- Feedback for every action: a click should change something visible or audible, like the monitor rhythm or the defibrillator charge sound.
- A goal: the HUD counts how many of the 12 equipment items you have explored. Small goals turn wandering into learning.
- Fast loading: Draco geometry and WebP textures keep this whole room near 1.5 MB, so it opens quickly on hospital Wi-Fi.
- No patient data: keep simulations free of real patient information so they never fall under health privacy rules like HIPAA.
Prerequisites
You should know the basics of a Three.js scene, camera and renderer; creating and animating simple 3D objects covers them. Loading a GLB is explained below step by step. Any GLB room model works; this one is a scan with added equipment.
Base scan: 'Charité University Hospital – Operating Room' by ChrisRE (Sketchfab), CC BY-NC. Cite: Queisner M. et al., VolumetricOR, Surg Innov 2022. Surgical equipment added for this demo. Patient body: merged skin-region meshes from Z-Anatomy (CC BY-SA 4.0), based on BodyParts3D, © The Database Center for Life Science (CC BY-SA 2.1 JP); the modified mesh (medsim-patient-skin-zanatomy.gltf) is shared under CC BY-SA 4.0.
How It Works
- Scene, camera and renderer. We make the 3D world, a camera at standing eye height (1.6 meters, because this model is built in real meters), and a renderer.
- Light the room. A sky-and-ground light fills the room evenly the way ceiling panels do, and a directional light adds shape.
- First-person controls and keys. PointerLockControls hides the mouse and turns mouse movement into looking around, like a first-person game.
- Load the compressed operating room. The whole room is one .glb file of about 1.5 MB.
- Collision: stop at walls and equipment. Blocked() asks one simple question: is this spot outside the room, or inside one of the equipment boxes?
- Walk with smooth acceleration and wall sliding. Instead of jumping a fixed distance per key press, the keys add to a velocity and friction slowly removes it, so you speed up and glide to a stop like a real person.
- Render loop: tour when idle, walk when locked. While nobody is walking, the camera circles the operating table and looks at it, which makes a calm tour.
The detailed code breakdown and the full copy-paste file are below. Every step is an exact excerpt of the full file, and the full file is the same code as the live demo.
What To Try Next
- Add a scenario: start in V-Fib, time how long the learner takes to find the crash cart and shock, then show a score.
- Label organs on an anatomy model with hover cards; see selecting 3D objects with a raycaster.
- Add touch controls for tablets with an on-screen joystick: mobile character controller.
- Build whole learning worlds: creating 3D virtual educational worlds.
Part 2: Interactive Anatomy Quiz (Three.js + Z-Anatomy)
The operating room teaches the space. Part 2 teaches the body. The Skeletal System game loads 263 real bones, lets students tap any bone to see its name and region, show or hide the skull, spine, ribcage, arms and legs, and then take a 12-question Bone Quest quiz. It is built portrait-first for phones and runs on Indie Forge Studio; the hero above and the patient on the table both open it.
1. Export one body system from Blender
Z-Anatomy ships the whole body as one Blender file, split into numbered system collections (skeletal, muscular, joints, cardiovascular, nervous, visceral and more). Most of its objects are labels, so the export script appends only the system you want, keeps the real meshes, bakes their transforms and stores the anatomical name and region chain as custom properties, which glTF exports as extras.
2. Decimate and compress for phones
The raw skeleton is about 675,000 triangles. A decimate pass on the large bones brings it to about 260,000, and gltf-transform welds, quantizes and meshopt-compresses it to a 2 MB file that loads fast on mobile data.
3. Load the GLB with GLTFLoader and MeshoptDecoder
The extras come through as userData on each mesh, so every bone knows its name and region without a separate lookup table. Three.js renames nodes with dots and spaces, so read the name from userData, not mesh.name.
4. Tap to select with a raycaster
On a phone a drag rotates the camera, so a tap only counts as a selection when the finger barely moved and lifted quickly. Hover is only used with a mouse.
5. The quiz engine and scoring
The quiz uses the same rules as the Falcon 9 Pad Quest quiz: shuffled questions and answers, instant green or red feedback, automatic advance, 100 points plus 20 per streak, a rank with up to three stars, and a best score saved on the device. Nine of twelve correct earns the Bone Expert badge. Each later system (muscles, organs, heart) reuses the same engine with a new config file.
Credits and license: anatomy models from Z-Anatomy (CC BY-SA 4.0), based on BodyParts3D, © The Database Center for Life Science (CC BY-SA 2.1 JP). The modified skeleton and patient meshes are shared under CC BY-SA 4.0. Z-Anatomy's inner-ear and kidney models are non-commercial and are not used. For learning only; not for diagnosis or clinical use.
Frequently Asked Questions
Can Three.js be used for medical simulations and training?
Yes. Three.js renders detailed anatomy models and full clinical rooms in the browser with GLTF loading, first-person navigation, physically based lighting and interactive equipment, with nothing to install.
What is PointerLockControls in Three.js?
PointerLockControls hides and locks the mouse cursor so mouse movement turns the camera like a first-person game. The browser only allows it after a user click, so call controls.lock() from a button, and the user presses Esc to unlock.
How do you load a compressed GLB model in Three.js?
Create a DRACOLoader, point setDecoderPath at the draco folder of the same Three.js version, attach it with gltfLoader.setDRACOLoader(dracoLoader), then call gltfLoader.load with the .glb path.
How do you stop the player walking through walls in Three.js?
Measure the floor and each large object with THREE.Box3, then before accepting a move check whether the new x and z fall inside a box grown by the player radius. If they do, undo the move on one axis at a time so the player slides along the wall.
What are the advantages of browser-based 3D medical simulations?
They need no installation, work on almost any device, update instantly for every learner and can be shared with a link, so students can practice anywhere without special hardware.
Is this medical simulation tutorial free?
Yes. The tutorial and the full code are free. Launch Full Code opens it in a new window, and the full-screen live demo only asks for a free Google sign-in.