# Line problem with rotatingY axis

**URL:** <https://discourse.processing.org/t/line-problem-with-rotatingy-axis/18131>\
**Category:** Coding Questions\
**Created:** [February 26, 2020, 7:07am UTC](https://discourse.processing.org/t/line-problem-with-rotatingy-axis/18131 "2020-02-26T07:07:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iriquois](https://avatars.discourse-cdn.com/v4/letter/i/41988e/32.png) [@iriquois](https://discourse.processing.org/u/iriquois)\
**Post date:** [February 26, 2020, 7:07am UTC](https://discourse.processing.org/t/line-problem-with-rotatingy-axis/18131/1 "2020-02-26T07:07:57Z")

</div>

the line becomes distorted when rotating in the Y axis, but if I make the same thing in processing it works fine! any ideas?

```auto
let btn, btn2;
let y = 0;
let x = 0;

function setup() {
  createCanvas(600, 400, WEBGL);
  
}

function draw() {
  background(0);
  noFill();
  stroke(255);
  //rotateX(x);
  rotateY(y);
  //rotateZ(x);
  point(-100, 0);
  point(100, 0);
  //draw a line
  beginShape(POINTS);
  strokeWeight(4);
  vertex(-100, 0);
  vertex(100, 0);
  endShape();
  
  strokeWeight(1);
  line(-100, 0, 0, 100, 0, 0);
  circle(0, 0, 200);
  y+=0.01;
  x+=0.01;
}

```

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [February 26, 2020, 1:48pm UTC](https://discourse.processing.org/t/line-problem-with-rotatingy-axis/18131/2 "2020-02-26T13:48:54Z")

</div>

Hi,

Welcome to the forum! 🙂  
First of all you can format your code with the `</>` button in the message editor.

I found that if you use anti-aliasing ([https://en.wikipedia.org/wiki/Spatial\_anti-aliasing](https://en.wikipedia.org/wiki/Spatial_anti-aliasing)) :

```auto
setAttributes('antialias', true);

```

([https://p5js.org/reference/#/p5/setAttributes](https://p5js.org/reference/#/p5/setAttributes))

It works with very thin thickness for your lines.

---

<div class="post-metadata">

**Author:** ![iriquois](https://avatars.discourse-cdn.com/v4/letter/i/41988e/32.png) [@iriquois](https://discourse.processing.org/u/iriquois)\
**Post date:** [February 26, 2020, 4:36pm UTC](https://discourse.processing.org/t/line-problem-with-rotatingy-axis/18131/3 "2020-02-26T16:36:52Z")

</div>

Hey thank you so much for your quick response and newbie user help. 👍
