# Strange but good looking bug with drawSphere and geom::Plane

**URL:** <https://discourse.libcinder.org/t/strange-but-good-looking-bug-with-drawsphere-and-geom-plane/701>\
**Category:** Using Cinder\
**Created:** [May 25, 2017, 8:02am UTC](https://discourse.libcinder.org/t/strange-but-good-looking-bug-with-drawsphere-and-geom-plane/701 "2017-05-25T08:02:13Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [May 25, 2017, 8:02am UTC](https://discourse.libcinder.org/t/strange-but-good-looking-bug-with-drawsphere-and-geom-plane/701/1 "2017-05-25T08:02:14Z")

</div>

![](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/1X/72909ae16653982a57bcaeb5f892f8ed16a4864e.png)

Rendered by this code (latest git on macOS):

```auto
    gl::enableWireframe();
    gl::draw( geom::Plane().subdivisions( ivec2( 19 ) ) );
    randSeed( 0 );
    for ( size_t i = 0; i < 37; i++ )
    {
        gl::drawSphere( 5.0f * randVec3(), randFloat( 0.1f, 1.0f ) );
    }
    gl::disableWireframe();

```

I suspect it is caused by a buffer overflow somewhere in the `gl::drawSphere` code.

-Gabor

---

<div class="post-metadata">

**Author:** ![rich.e](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/rich.e/32/1025_2.png) [@rich.e](https://discourse.libcinder.org/u/rich.e)\
**Post date:** [May 25, 2017, 6:06pm UTC](https://discourse.libcinder.org/t/strange-but-good-looking-bug-with-drawsphere-and-geom-plane/701/2 "2017-05-25T18:06:27Z")

</div>

That looks like the same thing I ran into and reported [here](https://github.com/cinder/Cinder/issues/1810), though I haven’t had time to look into a fix for it. Just switched to a `gl::Batch`. 🙂 But we should indeed fix that…

---

<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:** [May 25, 2017, 7:37pm UTC](https://discourse.libcinder.org/t/strange-but-good-looking-bug-with-drawsphere-and-geom-plane/701/3 "2017-05-25T19:37:49Z")

</div>

Thanks Rich. Somehow I missed that issue.
