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.
Page Index Toggle Pages: 1
Objects disappear (Read 480 times)
Objects disappear
Feb 23rd, 2008, 7:53pm
 
Hello,

import processing.opengl.*;
import javax.media.opengl.*;
int z=0;
void setup(){
 frameRate(20);
 size(500,200,OPENGL);
};
 
void draw() {
  background(0);
 pushMatrix();
   
   translate(width/2,height/2,z-=10);
   fill(255,255,255,255);
   ellipse(0,0,200,200);
 
  popMatrix();
  println(z);
}


In the OPENGL Mode all Objects < -1560 disappear. In the P3D everthing works correctly.
Does anybody know why?
Re: Objects disappear
Reply #1 - Feb 24th, 2008, 10:55pm
 
Looks like a clipping plane problem.

Have a try with properly setting the near and far values with the frustum method :
http://processing.org/reference/frustum_.html

For example :
Code:
frustum(-width/2, width/2, -height/2, height/2, -100, 200); 

Re: Objects disappear
Reply #2 - Feb 25th, 2008, 10:00am
 
Works! Thx for the tip.
Page Index Toggle Pages: 1