# My contour doesn't work

**URL:** <https://discourse.processing.org/t/my-contour-doesnt-work/41193>\
**Category:** Coding Questions\
**Created:** [March 8, 2023, 7:51am UTC](https://discourse.processing.org/t/my-contour-doesnt-work/41193 "2023-03-08T07:51:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TF-SHOCK76](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@TF-SHOCK76](https://discourse.processing.org/u/TF-SHOCK76)\
**Post date:** [March 8, 2023, 7:51am UTC](https://discourse.processing.org/t/my-contour-doesnt-work/41193/1 "2023-03-08T07:51:58Z")

</div>

I tried to create a plane with a hole in the middle. It works with the example on the documentation, but I don’t succeed to make it work with my values. Is there any constraint on values?  
Here is my code:

```auto
float x = 980;
float y = 280;
void setup() {
  size(900, 900, P3D);
  
}

void draw() {
  
 translate(200,200);  
 createShape();
 beginShape();
    textureMode(NORMAL);
    shininess(200);
    emissive(0, 0, 0);
    normal(0, 0, 1);
    vertex(-x/2, -y/2, 0, 0); 
    vertex(x/2, -y/2, 1, 0); 
    vertex(x/2, y/2, 1, 1); 
    vertex(-x/2, y/2, 0, 1); 
     
    beginContour();
      vertex(-x/2+115, -y/2+35, 0, 0); 
      vertex(x/2-115, -y/2+35, 1, 0); 
      vertex(x/2-115, y/2-105, 1, 1); 
      vertex(-x/2+115, y/2-105, 0, 1); 
     endContour();
     
   endShape(CLOSE);
}

```

Can you help me please?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 8, 2023, 11:17am UTC](https://discourse.processing.org/t/my-contour-doesnt-work/41193/2 "2023-03-08T11:17:28Z")

</div>

Hello @TF-SHOCK76,

Read the reference carefully about the winding direction:  
[https://processing.org/reference/beginContour\_.html](https://processing.org/reference/beginContour_.html)

Once I corrected your code (winding of vertices) it worked:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/7/b70e506ffa72d0e85b870e985fc78d522b55fdfd.png)

Some code to help you see the co-ordinates:

```auto
void setup()
  {
  size(500, 500);  
  }

void draw() 
  {
  background(255);
  strokeWeight(5);
  point(mouseX, mouseY);
  fill(0);
  text(str(mouseX) + ", " + str(mouseY), mouseX +10, mouseY);
  println(mouseX, mouseY);
  }

```

References:

> **[Coordinate System and Shapes](https://processing.org/tutorials/coordinatesystemandshapes/)**
>
> Drawing simple shapes and using the coordinate system.

`:)`

---

<div class="post-metadata">

**Author:** ![TF-SHOCK76](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@TF-SHOCK76](https://discourse.processing.org/u/TF-SHOCK76)\
**Post date:** [March 8, 2023, 12:31pm UTC](https://discourse.processing.org/t/my-contour-doesnt-work/41193/3 "2023-03-08T12:31:20Z")

</div>

Hi glv,  
Thank for your reply! It works now ^^  
Bye,

TF.
