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 & HelpOpenGL and 3D Libraries › nasty lines inside shapes in 3d scene
Page Index Toggle Pages: 1
nasty lines inside shapes in 3d scene (Read 1874 times)
nasty lines inside shapes in 3d scene
Jan 8th, 2010, 4:10am
 
hello folks and happy new year to all!
I 'll appreciate much your help to resolve a little nasty problem with my 3D application.
When i use ellipse function or rect etcc with P3D render in my own PGraphics object there are nasty black lines inside the shape and i don't know how to eliminate them using this render.
Using OPENGL the nasty lines inside the ellipses disappear but i have another problem.
They doesn't look like really ellipse when they are far from the camera  in 3D scene, they look like hexagons..
some one can help me??

Thanks a ton and sorry for my bad english
Re: nasty lines inside shapes in 3d scene
Reply #1 - Jan 8th, 2010, 5:55am
 
Could you post a small code example?  It would go a long way toward understanding the issue.  Thanks..
Re: nasty lines inside shapes in 3d scene
Reply #2 - Jan 8th, 2010, 6:18am
 
it probably looks like this :  http://dl.dropbox.com/u/1152794/circleProblem.jpg
that happens when using smooth in P3D. Cant remember if there was a solution beside removing smooth...
Re: nasty lines inside shapes in 3d scene
Reply #3 - Jan 8th, 2010, 6:24am
 
Could probably use noStroke() or set the stroke color to black.
I'm not seeing the issue if I do something like this..
Code:
void setup(){
size(500,300,P3D);
smooth();
}

void draw() {
fill(0);
ellipse(156, 146, 155, 155);
}
Re: nasty lines inside shapes in 3d scene
Reply #4 - Jan 8th, 2010, 7:12am
 
try to add a white background to draw, then you see it
Re: nasty lines inside shapes in 3d scene
Reply #5 - Jan 8th, 2010, 7:31am
 


use

noSmooth();

Re: nasty lines inside shapes in 3d scene
Reply #6 - Jan 8th, 2010, 7:42am
 
we figured that out, the question is, is there a better solution where you can still use smooth
Re: nasty lines inside shapes in 3d scene
Reply #7 - Jan 8th, 2010, 7:58am
 
One solution is to draw the circle with noStroke() and noSmooth() then draw it again with stroke(), noFill() and smooth(). That way it will look smooth without the lines inside. The downside is that you have to draw it twice.
Re: nasty lines inside shapes in 3d scene
Reply #8 - Jan 8th, 2010, 8:57am
 
There is a bug in the P3D rending mode that causes lines and shapes that are behind the viewpoint to be displayed as if in front. This can cause very distorted images. See bug report
http://dev.processing.org/bugs/show_bug.cgi?id=1393

P3D works fine if everything to be drawn is in front of the view point but for anything else OPENGL is the solution.
Wink
Re: nasty lines inside shapes in 3d scene
Reply #9 - Jan 8th, 2010, 9:12am
 
thats not the same problem i guess
Re: nasty lines inside shapes in 3d scene
Reply #10 - Jan 8th, 2010, 10:58am
 
On second thought I think you are right in that it is a different problem. But when cuca said
Quote:
Using OPENGL the nasty lines inside the ellipses disappear

made me think of it and it is probably worth knowing.
Smiley

I spent a couple of days on the Shapes3D library trying to sort out shape picking before I discovered the bug was not actually in my code!
Sad
Re: nasty lines inside shapes in 3d scene
Reply #11 - Jan 11th, 2010, 7:52am
 
thanks to all guys for your interest.
The problem is exactly what cedric show us on that link.
i'm developing an audio video with OPENGL render but i'd like to produce some shot image of the application also,that's the reason i would use P3D in PGraphics object to obtain high quality image.
good job to all
Page Index Toggle Pages: 1