# ParticleSphereGPU sample -\> How do I draw lines instead of points

**URL:** <https://discourse.libcinder.org/t/particlespheregpu-sample-how-do-i-draw-lines-instead-of-points/653>\
**Category:** Using Cinder\
**Created:** [April 11, 2017, 6:42pm UTC](https://discourse.libcinder.org/t/particlespheregpu-sample-how-do-i-draw-lines-instead-of-points/653 "2017-04-11T18:42:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrFuzzy](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MrFuzzy](https://discourse.libcinder.org/u/MrFuzzy)\
**Post date:** [April 11, 2017, 6:42pm UTC](https://discourse.libcinder.org/t/particlespheregpu-sample-how-do-i-draw-lines-instead-of-points/653/1 "2017-04-11T18:42:29Z")

</div>

Hey there,

I am currently playing around with the ParticleSphereGPU sample (cinder 0.9.1\_mac), trying to learn GLSL.  
My Question is, how I go about drawing a line for every particle, from position to pposition (previous position) instead of just a point at position.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [April 11, 2017, 9:39pm UTC](https://discourse.libcinder.org/t/particlespheregpu-sample-how-do-i-draw-lines-instead-of-points/653/2 "2017-04-11T21:39:04Z")

</div>

Hi,

to start, change the primitive type from `GL_POINTS` to `GL_LINES`. You then need to supply 2 vertices per line, instead of 1 vertex per point. That’s all 🙂

To learn more about OpenGL primitives and how to supply vertex data, see [this link](https://www.codeproject.com/Articles/23991/OpenGL-Geometric-Primitives).

-Paul

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [April 12, 2017, 12:02pm UTC](https://discourse.libcinder.org/t/particlespheregpu-sample-how-do-i-draw-lines-instead-of-points/653/3 "2017-04-12T12:02:54Z")

</div>

Hi,

I would use a geometry shader to generate a line segment from the current and the previous position attributes.

-Gabor
