maximeq / three-js-capsule-geometry

A CapsuleBufferGeometry as a new geometry primitive for THREE.JS
MIT License
33 stars 3 forks source link

How to implement the capsule? #1

Closed Rikaius closed 5 years ago

Rikaius commented 5 years ago

I'm new to Javascript.

I found your code and I do not know how to implement it in my project.

You could write a sample code on how to implement the capsule.

Thank you!

maximeq commented 5 years ago

Hi ! Will see if I can add an example, but actually it's pretty straightforward as it works like any three.js geometry class (if you are new to three.js, you should play with ti first).

You can include one of the dist/browser/ files in your webpage (THREE must be included first), then THREE.CapsuleBufferGeometry will be defined and possible to use.

As for parameters, they are similar to other *BufferGeometry classes in three.js.

maximeq commented 5 years ago

I added an example, along with a bug fix reported today. Should be easier to play with it now.