# Cannot specify sphereDetail when using createShape SPHERE

**URL:** <https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912>\
**Category:** Beginners\
**Created:** [July 29, 2020, 6:45pm UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912 "2020-07-29T18:45:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieltorrer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/danieltorrer/32/1631_2.png) [@danieltorrer](https://discourse.processing.org/u/danieltorrer)\
**Post date:** [July 29, 2020, 6:45pm UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912/1 "2020-07-29T18:45:16Z")

</div>

When creating a `sphere()` you are able to specify the number of vertices it has if you previously call `sphereDetail()`. However seems that there is no way to specify the detail when using `createShape(SPHERE, size)`.

Does anyone knows a way to set it? I want to create a bunch of spheres and storing them in PShapes seems more performant than doing a lot of `sphere()` calls

I checked the source code but couldn’t find anything. Niether trying `createShape(SPHERE` with more params (brute force)

---

<div class="post-metadata">

**Author:** ![behreajj](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@behreajj](https://discourse.processing.org/u/behreajj)\
**Post date:** [July 29, 2020, 7:04pm UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912/2 "2020-07-29T19:04:27Z")

</div>

Hi @danieltorrer,

The way of specifying sphere detail is the same as with `sphere`.

```auto
PShape shp;

void setup() {
  size(256, 256, P3D);
  sphereDetail(4, 3);
  shp = createShape(SPHERE, 100.0);
}

void draw() {
  background(#ffffff);
  camera(0, 0, height * 0.86602, 0, 0, 0, 0, 1, 0);
  rotate(frameCount * 0.01, 0, 1, 0);
  shape(shp);
}

```

The sphere shape uses the latitude and longitude from the renderer.

Best,  
Jeremy

---

<div class="post-metadata">

**Author:** ![danieltorrer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/danieltorrer/32/1631_2.png) [@danieltorrer](https://discourse.processing.org/u/danieltorrer)\
**Post date:** [July 30, 2020, 7:10am UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912/3 "2020-07-30T07:10:38Z")

</div>

Solved! Thanks @behreajj  
I can’t believe how I never tried that 😑

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [August 2, 2020, 2:41am UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912/4 "2020-08-02T02:41:34Z")

</div>

Conceptually, all these parameter-setting methods (strokeWeight, textAlign, sphereDetail, etc.) are then used by the appropriate drawing functions without needing to pass all the parameters explicitly. This fits with Processing’s general “learners-should-have-to-pass-6-arguments” API design.

Keep in mind that these are canvas-level settings. sphereDetail() controls the main canvas, but if you are creating a PGraphics pg and drawing to it with pg.shape(), then you need to call a setting pg.sphereDetail().

```auto
PGraphics pg;
void setup() {
  size(400, 200, P3D);
  pg = createGraphics(200, 200, P3D);
}
void draw() {
  background(128);

  pg.beginDraw();
  pg.background(128);
  pg.sphereDetail(20);
  pg.translate(100, 100);
  pg.sphere(80);
  pg.endDraw();
  image(pg, 0, 0);

  sphereDetail(10);
  translate(300, 100);
  sphere(80);

}

```

 ![Screen Shot 2020-08-01 at 7.40.48 PM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/221b15ce997cc96e21b7336852a1eec69875ddf8.png)
