G
G
GF2020-10-03 18:28:43
three.js
GF, 2020-10-03 18:28:43

Where can I find the example code from the docs?

5f78985bb3f75787731597.png
Where can I find the example code from the docs? https://threejs.org/docs/index.html#api/en/geometr...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2020-10-03
@fomenkogregory

Uproot from the source of the page. You open the example in a new window, you find it in html <script type="module">, it will contain the guis object

var guis = {
  // ....
  IcosahedronGeometry: function ( mesh ) {

    var data = {
      radius: 10,
      detail: 0
    };

    function generateGeometry() {

      updateGroupGeometry( mesh,
        new IcosahedronGeometry(
          data.radius, data.detail
        )
      );

    }

    var folder = gui.addFolder( 'THREE.IcosahedronGeometry' );

    folder.add( data, 'radius', 1, 20 ).onChange( generateGeometry );
    folder.add( data, 'detail', 0, 5 ).step( 1 ).onChange( generateGeometry );

    generateGeometry();

  },
  // ....
}

V
Vladislav Lyskov, 2020-10-03
@Vlatqa

Here you follow your own link and at the bottom there is a link to the source code on the github, is that not it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question