We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › problem with low resolution and lines
Page Index Toggle Pages: 1
problem with low resolution and lines (Read 389 times)
problem with low resolution and lines
Dec 3rd, 2008, 2:09pm
 
hi,

i'm using a PGraphic with P3D to draw this cube but as you can see i have a problem with the render, it cuts the lines.

how can i fix it?
http://tday.ptumpa.com/cube1.png

Q
Re: problem with low resolution and lines
Reply #1 - Dec 6th, 2008, 10:10am
 
Maybe someone can help if you post some code. Without that it's hard to guess what's going on here.
Re: problem with low resolution and lines
Reply #2 - Dec 6th, 2008, 11:01am
 
this is the code i used to draw each single side, it draws 64 squares(8x8)

http://pastie.org/332556
Re: problem with low resolution and lines
Reply #3 - Dec 7th, 2008, 8:02am
 
Make sure you're not drawing the sides or the box twice elsewhere in the code (because the image looks a bit like there's Z-fighting happening).

The other thing I noticed is that you're passing integer constants to the translate and vertex methods.

Try passing floats instead.  So, original code:

previewScreen.translate(x-4,y-4,4);

Changes to:
previewScreen.translate(x-4.0f,y-4.0f,4.0f);

Also, either make x and y floats in their declaration or cast them:

previewScreen.translate((float)x-4.0f,(float)y-4.0f,4.0f);

I don't know that that will fix your problem, but it's good practice anyway Smiley

Page Index Toggle Pages: 1