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 › Old constant MAX_FLOAT ?
Page Index Toggle Pages: 1
Old constant MAX_FLOAT ??? (Read 934 times)
Old constant MAX_FLOAT ???
Oct 30th, 2006, 10:12pm
 
Hi,

I want to convert some old code, where BApplet is still used.

there is on line saying something like:
g.zbuffer[i]=MAX_FLOAT;

What is it doing - can I just comment it out ?

I didn't find anything in the http://processing.org/download/revisions.txt about it. However MAX_FLOAT is gone in version 00119.

Cheers,
sb
Re: Old constant MAX_FLOAT ???
Reply #1 - Oct 30th, 2006, 10:55pm
 
What it's doing is clearing the z-buffer (e.g. the depth data) so that anything drawn after it ignores the depth of previous things. I assume since it's there, it's necessary.
Re: Old constant MAX_FLOAT ???
Reply #2 - Oct 31st, 2006, 12:19am
 
Thanks - but MAX_FLOAT was a constant in BApplet - now everybody uses PApplet which lacks a MAX_FLOAT !!!

What am I supposed to use instead of MAX_FLOAT ???
Re: Old constant MAX_FLOAT ???
Reply #3 - Oct 31st, 2006, 12:38am
 
MAX_FLOAT has been in every previous version of Processing, I assume that the lack of it is a mistake in 0119.

To replace it try:

float MAX_FLOAT=3.4028235E38;
Re: Old constant MAX_FLOAT ???
Reply #4 - Oct 31st, 2006, 12:56am
 
I am new to Processing - should I file a bug report...again, there is nothing in revisions.txt

Or could anyone file one since I just started...
Re: Old constant MAX_FLOAT ???
Reply #5 - Oct 31st, 2006, 2:05pm
 
use Float.MAX_VALUE instead.
Page Index Toggle Pages: 1