Command Palette

Search for a command to run...

Hectal
Phase 2: Just Enough 3D Math
3D Web · Exercise 5 of 5 Previous
Intermediate

Write tubeBetween and place the fork tube

Finish the function tubeBetween(from, to, radius, name) so it returns a cylinder mesh whose two ends are exactly the points from and to.

Then add a tube named fork-test from the bottom of the head tube (0.47, 0.7, 0) to the front axle (0.58, 0.35, 0), radius 0.014.

What Check tests

  1. A cylinder mesh named fork-test exists
  2. It is as long as the distance between the two points (0.3669 m)
  3. Its centre is halfway, at (0.525, 0.525, 0)
  4. Its length axis points along the line between the points
  5. At most 2 draw calls

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.