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 › 3d boolean in processing
Page Index Toggle Pages: 1
3d boolean in processing? (Read 602 times)
3d boolean in processing?
Nov 8th, 2006, 5:43pm
 
is it possible to have 3d boolean in processind?
is there any example code?

thanx

punchik
Re: 3d boolean in processing?
Reply #1 - Nov 8th, 2006, 6:45pm
 
is there a third dimension to "true" and "false"?
Boolean is exactly that.. a variable where you can store the value true, or false..
usage is i.e. for a checkbox' selected state.

Code:

boolean selected = false; // make a boolean variable
void draw(){
background(255); // set background to white
fill(0); // set fill color to black
if(selected){ // if selected is true, fill with red
fill(255,0,0);
}
rect(0,0,width/2,height/2); // draw rectangle
}
void mousePressed()
{
selected = !selected; // invert value
}
Re: 3d boolean in processing?
Reply #2 - Nov 8th, 2006, 7:26pm
 
I guess, he's referring to 3D boolean operations (AND, OR, XOR, NOT) and not actual datatypes...

And no Processing hasn't got this built in, but one could write a library for that. The maths can be quite involved though...
Page Index Toggle Pages: 1