Creating a spline curve between two points

When you create visualizations and, for instance, want to visualize the flight path of an airplane, drawing a curve between the start and end point is a good approach. In this recipe, we'll show you how you can do this using the standard THREE.TubeGeometry object.

Getting ready

When you open the example for this recipe, 02.12-create-spline-curve.html, you can see a tube geometry that curves from start to end:

Getting ready

In the upcoming section, we'll explain step by step how to create this curve.

How to do it...

To create a curved spline, like what is shown in the preceding example, we need to take a couple of simple steps: ...

Get Three.js Cookbook 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.