Skip to content
Advertisement

How to effectively use TraingleStripDrawMode in three.js?

THREE.js have included TriangleStripDrawMode, or TriangleFanDrawMode for some revisions now.

I have tried searching for it online, as well as experimenting on my own to understand it better, but all is wasted. I still don’t know how to utilize these modes to prevent redundancy, or to minimize the data exchange.

Consider this mesh for example:

JavaScript

unless I replace // Placeholder with

JavaScript

What is the use of setting the draw mode if I end up replicating indices – 2, 0 here? Or is there something obvious that I am missing?

Advertisement

Answer

You should use THREE.BufferGeometry if you want to use THREE.TriangleStripDrawMode.

Here is a very simple example:

JavaScript

three.js r.76

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement