O'Reilly logo

Three.js Essentials by Jos Dirksen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating parametric trees

For the last example, we'll look at how you can use an existing library to easily create parametric geometries. In this case, we'll show you how to create trees like the ones shown in the following screenshot (05.05-generated-tree):

Creating parametric trees

Note

The library we use to create this generated tree is called proctree.js, which you can download from GitHub at the following link:

https://github.com/supereggbert/proctree.js/

This library allows you to specify a bunch of parameters, which are used to create a tree geometry. To get this to work with Three.js, we have to convert the information provided by this library to Three.js. Let's look ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required