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 › z, depth or layer position with JAVA2D
Page Index Toggle Pages: 1
z, depth or layer position with JAVA2D (Read 613 times)
z, depth or layer position with JAVA2D
Oct 6th, 2008, 12:57pm
 
Hi,

I couldn't find a answer to that. The only possible way of doing this seems to be when using P3D or OPENGL.

When you write in JAVA2D, the z position is define by the order you write elements. ex:

rect(x, y, width, height); // Behind
ellipse(x, y, width, height) //Front

Is there a way to add the z position without using 3D ?

Cheeeeeers.

Re: z, depth or layer position with JAVA2D
Reply #1 - Oct 6th, 2008, 1:19pm
 
Is it because we are filling pixels in JAVA2D? It go trough draw() and draw everything on top of each other. At the end, it cleans everything and go through draw() again. That's why the background() is needed to clean the 'scene'.
Re: z, depth or layer position with JAVA2D
Reply #2 - Oct 6th, 2008, 6:09pm
 
See Display depth question

In Java2D, Processing uses the painter algorithm...
Re: z, depth or layer position with JAVA2D
Reply #3 - Oct 8th, 2008, 5:47pm
 
Thanks a lot PhiLho. I think it's not the first time you'r helping me and others at the same time. Thanks a lot.
I have a look into it.
Page Index Toggle Pages: 1