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.
IndexSuggestions & BugsSoftware Bugs › ortho() weirdness
Page Index Toggle Pages: 1
ortho() weirdness (Read 1434 times)
ortho() weirdness
May 12th, 2005, 7:42pm
 
The following code produces different results with OPENGL and P3D (version 0089). The P3D looks as expected, but OPENGL will just show a blank canvas.

Additional oddity: In P3D it works correctly, but ortho() automagically centers the world coords around the top left corner of the window. Maybe that's supposed to happen, what do I know.

Code:
import processing.opengl.*;

void setup() {
size(1066,200, P3D);
framerate(5);
}

void draw() {
background(200);
lights();
ortho(0,width, 0,height, -10,20);

translate(width/2,height/2);
for(int i=0; i<10; i++) {
pushMatrix();
translate(random(width),random(height));
rotateX(PI/4);
rotateY(PI/4);
box(50);
popMatrix();
}

}

Re: ortho() weirdness
Reply #1 - May 13th, 2005, 6:11am
 
i'm guessing that opengl is a bit more restricted about the default clipping planes. will check into it.

the oddity is how it's supposed to behave (if i'm understanding correctly. if you ask for ortho from (0, 0) to (width, height), you're gonna get all your coordinates mapped into that range, no?
Re: ortho() weirdness
Reply #2 - May 13th, 2005, 2:52pm
 
That's what I thought too, but it maps values in the range (-width/2,-height/2) to (width/2,height/2), hence the translate in the code to bring it back on the screen.

I was just testing ortho() to see if it was an alternative to perspective rendering since the aspect ratio of my canvas is so extreme that perspective yields correct but weird effects. So it's not a big priority, I'm sure there are more important bugs to fix.
Re: ortho() weirdness
Reply #3 - May 13th, 2005, 3:28pm
 
hm, that sounds like a problem then. i'll get that on the list to check out.
Re: ortho() weirdness
Reply #4 - Jul 28th, 2005, 5:00am
 
filed in the bugs db:
http://dev.processing.org/bugs/show_bug.cgi?id=100
closing thread.
Page Index Toggle Pages: 1