Steering Behaviors: flow field, dot product, scalar projection

Simon’s big project the last couple of days was about making a steering behaviors database, complete with a navigation menu (in Cloud9):

Steering Behaviors Navigation Menu 24 Mei 2017

He managed to finish the first two examples – “Seek and Flee” and “Pursuit and Evasion” – and worked on the Flow Field Following and Path Following.

As recommended by Daniel Shiffman, Simon largely relied on the paper called Steering Behaviors For Autonomous Characters (written by Craig W. Reynolds from Sony). As Simon told me, he tried to guess the code to make the static drawings in the paper come to life. For instance, for the “Seek and Flee” example, Simon animated this drawing:

Craig W. Reynolds Steering Behaviors Seek and Flee 25 Mei 2017

 

 

 

Simon also made a “Seek” example in the language called Lua (from the Codea app):

 

The second example was about Pursuit and Evasion:

Craig W. Reynolds Steering Behaviors Pursuit and Evasion 25 Mei 2017

 

 

Simon also explained to me how Flow Field Following worked:

 

Another steering behavior he scrutinized was Path Following. For Path Following, he first had to learn what the “dot product” was. In math, the dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number.

The way Simon learns is usually by studying (deconstructing) and memorizing the formulas (even if he doesn’t fully understand them in the beginning). After he comes back to the formula later on he seems to have grasped the meaning of it.  I often observe him actually apply different formulas in real life. When it comes to the “dot product”, Simon is in the beginning of the learning curve:

 

 

 

The formula for scalar projection is:

s=|{\mathbf  {a}}|\cos \theta ={\mathbf  {a}}\cdot {\mathbf  {{\hat  b}}},

or the way Simon put it:

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s