New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering extra polygons? #4012

Closed
jdrage opened this Issue Oct 17, 2015 · 12 comments

Comments

Projects
None yet
5 participants
@jdrage

jdrage commented Oct 17, 2015

Hi, I've got a simple patch which seems to render some extra "stuff".

I'm attaching the .pde and a screen shot.

I'm running Processing 3.0 release on Windows 10 on a Lenovo ThinkPad W520 (using the NVIDIA adapter if that matters).

Thanks,
James

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 17, 2015

bug_extra_lines

Hmm. Can't seem to attach a .pde, so I'll paste the source code below.

In the screen shot you can see the dark diagonal lines below the waves, they seem to converge at a common point.


/**
 * Bug: Extra lines rendered. 
 */


float t = 0.0;
float[][][] p = new float[80][80][3]; // points for our shape


void setup()
{
  size(1280, 960, P3D);  
  stroke(255, 255);
  noFill();
}

void update()
{
  // Update the time
  t += 0.01;

  float w = 600.0;
  float h = 10.0;
  float in;
  float jn;

  // update the points
  for (int i = 0; i < p[0].length; i++)
  {
    for (int j = 0; j < p.length; j++)
    {
      in = (float)i * w / p.length - w/2;
      jn = (float)j * w / p[0].length - w/2;

      p[i][j][0] = jn * 2.0;
      p[i][j][1] = sin(jn + t * 8.0) * h - h/2.0;
      p[i][j][2] = in;
    }
  }
}

void draw()
{  
  background(0);
  scale(2.0);

  update();
  drawCurves();

  // Change the view
  camera(0.0, -height - 10.0 + 5.0 * sin(t * 2.0), (height/2.0) / tan(PI*30.0 / 180.0), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}

void drawCurves()
{
  for (int i = 0; i < p.length; i++)
  {
    beginShape();
    for (int j = 0; j < p[0].length; j++)
    {
      curveVertex(p[i][j][0], p[i][j][1], p[i][j][2]);
    }
    endShape();
  }
}

jdrage commented Oct 17, 2015

bug_extra_lines

Hmm. Can't seem to attach a .pde, so I'll paste the source code below.

In the screen shot you can see the dark diagonal lines below the waves, they seem to converge at a common point.


/**
 * Bug: Extra lines rendered. 
 */


float t = 0.0;
float[][][] p = new float[80][80][3]; // points for our shape


void setup()
{
  size(1280, 960, P3D);  
  stroke(255, 255);
  noFill();
}

void update()
{
  // Update the time
  t += 0.01;

  float w = 600.0;
  float h = 10.0;
  float in;
  float jn;

  // update the points
  for (int i = 0; i < p[0].length; i++)
  {
    for (int j = 0; j < p.length; j++)
    {
      in = (float)i * w / p.length - w/2;
      jn = (float)j * w / p[0].length - w/2;

      p[i][j][0] = jn * 2.0;
      p[i][j][1] = sin(jn + t * 8.0) * h - h/2.0;
      p[i][j][2] = in;
    }
  }
}

void draw()
{  
  background(0);
  scale(2.0);

  update();
  drawCurves();

  // Change the view
  camera(0.0, -height - 10.0 + 5.0 * sin(t * 2.0), (height/2.0) / tan(PI*30.0 / 180.0), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}

void drawCurves()
{
  for (int i = 0; i < p.length; i++)
  {
    beginShape();
    for (int j = 0; j < p[0].length; j++)
    {
      curveVertex(p[i][j][0], p[i][j][1], p[i][j][2]);
    }
    endShape();
  }
}
@jmcelwain

This comment has been minimized.

Show comment
Hide comment
@jmcelwain

jmcelwain Oct 17, 2015

Hey, I thought your sketch looked fun so I loaded up on my computer (MBP) and didn't see any irregularities (i.e. dark diagonal lines). I'm guessing it has something to do with your hardware--maybe someone smarter than me has some idea.

jmcelwain commented Oct 17, 2015

Hey, I thought your sketch looked fun so I loaded up on my computer (MBP) and didn't see any irregularities (i.e. dark diagonal lines). I'm guessing it has something to do with your hardware--maybe someone smarter than me has some idea.

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 18, 2015

Thanks for trying it out.

jdrage commented Oct 18, 2015

Thanks for trying it out.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Oct 18, 2015

Contributor

This is probably a duplicate of #4007.

Contributor

JakubValtar commented Oct 18, 2015

This is probably a duplicate of #4007.

@erniejunior

This comment has been minimized.

Show comment
Hide comment
@erniejunior

erniejunior Oct 18, 2015

Contributor

No weird lines here on my Thinkpad as well (using an integrated intel card).

Contributor

erniejunior commented Oct 18, 2015

No weird lines here on my Thinkpad as well (using an integrated intel card).

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Oct 18, 2015

Contributor

I'm getting glitches even on Intel, but I have to rotate it.

void draw()
{  
  background(0);
  scale(2.0);
  rotateX(map(mouseY, 0, height, -PI, PI));
  rotateY(map(mouseX, 0, width, -PI, PI));
  ...

glitches

Contributor

JakubValtar commented Oct 18, 2015

I'm getting glitches even on Intel, but I have to rotate it.

void draw()
{  
  background(0);
  scale(2.0);
  rotateX(map(mouseY, 0, height, -PI, PI));
  rotateY(map(mouseX, 0, width, -PI, PI));
  ...

glitches

@codeanticode codeanticode added the opengl label Oct 18, 2015

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 19, 2015

Yes, rotation definitely affects it. Sometimes the endpoints shift to a different "row" in the wave.

jdrage commented Oct 19, 2015

Yes, rotation definitely affects it. Sometimes the endpoints shift to a different "row" in the wave.

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 19, 2015

Thanks Jakub, that does look like the same issue.

jdrage commented Oct 19, 2015

Thanks Jakub, that does look like the same issue.

@erniejunior

This comment has been minimized.

Show comment
Hide comment
@erniejunior

erniejunior Oct 19, 2015

Contributor

OK with the rotation I can confirm it too,

Contributor

erniejunior commented Oct 19, 2015

OK with the rotation I can confirm it too,

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Oct 19, 2015

Member

It is in fact a duplicate of #4027. Fixed with ed76e73

Member

codeanticode commented Oct 19, 2015

It is in fact a duplicate of #4027. Fixed with ed76e73

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 21, 2015

Thanks for the quick turnaround. I am doing a show on the 29th, I'm hoping to get a release with this fix.

jdrage commented Oct 21, 2015

Thanks for the quick turnaround. I am doing a show on the 29th, I'm hoping to get a release with this fix.

@jdrage

This comment has been minimized.

Show comment
Hide comment
@jdrage

jdrage Oct 25, 2015

Fixed in 3.0.1. Yay!

jdrage commented Oct 25, 2015

Fixed in 3.0.1. Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment