Understanding ease motions

Assume that there is a train running from station A to station B within 15 minutes. We would like to simulate this scenario by altering the transformation matrix of the train in an update callback. The simplest way is to put the train at station A at time point 0, and at station B at time point 15 (minutes), and move it evenly in the transition phase. A heavily-employed method used here is the linear interpolation. This draws a straight line between two neighboring samples P0 and P1, and returns the appropriate point P along the line, which can be used to represent translation and scale operations of nodes. It is commonly expressed in the following form:

P = (1 - t) * P0 + t * P1

Here, t is a number between 0 and 1.

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.