# First time working with beginShape and endShape

**URL:** <https://discourse.processing.org/t/first-time-working-with-beginshape-and-endshape/9810>\
**Category:** Coding Questions\
**Created:** [March 31, 2019, 11:41am UTC](https://discourse.processing.org/t/first-time-working-with-beginshape-and-endshape/9810 "2019-03-31T11:41:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZachMcMkay](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@ZachMcMkay](https://discourse.processing.org/u/ZachMcMkay)\
**Post date:** [March 31, 2019, 11:41am UTC](https://discourse.processing.org/t/first-time-working-with-beginshape-and-endshape/9810/1 "2019-03-31T11:41:35Z")

</div>

So basically this is code for a project. I have the circles rotating how I’d like them to, I also have a point on the inner circle rotating how i’d like it to. The point’s x and y positions are being saved in an array after first becoming a vector. Later on in my show function i tried a for loop to draw a vertex at each x and y position. However it only draws a vertex at the current x and y point. Im very confused, been trying this for ages.

link to code: [https://editor.p5js.org/ZachMcMkay/sketches/ooBViYgh1](https://editor.p5js.org/ZachMcMkay/sketches/ooBViYgh1)

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [April 2, 2019, 1:23am UTC](https://discourse.processing.org/t/first-time-working-with-beginshape-and-endshape/9810/2 "2019-04-02T01:23:12Z")

</div>

in this version  
[https://editor.p5js.org/kll/sketches/ngqEdx1IF](https://editor.p5js.org/kll/sketches/ngqEdx1IF)  
i try:

```auto
//curve.getX(px);
//curve.getY(py);|
curve.addPoint(px,py);

```

with:

```auto
  addPoint(x,y){
    this.current = createVector();
    this.current.x = x;
    this.current.y = y;
    this.path.push(this.current);
  }

```

![SNAG-0050](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1201ff2b9b716dae1818b50053fd53a412e7f72b.jpeg)
