logo
By Lawrence

15 minutes

Road Projection

This lesson starts from the lab, with every edit from lessons 1 and 2 undone.

World space and road space

The car stores its position as world x and z. The road works in road space, which lesson 1.7 used for the traffic: s, how far along the road, and u, how far across it. Lane 1, a shoulder, a bridge deck: each of those is a question about s and u. So every lane check first turns the car's x, z into s, u.

On the straight start, that is free: s is z and u is x. On a bend it is not. The line straight across the road from the car meets the centre line a little ahead of the car, or a little behind it, not level with it.

A bend seen from above, with the centre line curving up and to the left. The car sits in the left lane. A dashed line goes straight sideways from the car to the centre line at the same z. A solid line goes square across the road from the car and meets the centre line 0.72 m further along. That solid line is labelled u = 1.85 m, and where it lands is labelled s = 557.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$5one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search