From: Jonathan B. <jbr...@ea...> - 2004-08-11 21:14:20
|
On Wed, 2004-08-11 at 16:51, Bruce Sherwood wrote: > I don't understand the "near-clipping plane" problem. Is it simply that > you want to set scene.autoscale = 0? > > Here is the bug report you submitted, for Linux: > > "My program is a test of a rigid body simulation package, pyode. The > scene consists of a few boxes near position (0,0,0) and a sphere. > The sphere starts from a position behind the viewer, rolls towards > the boxes, crashes into them, bounces back towards the viewer, > then continues to roll far behind the viewer. After the sphere rolls > for a little while, the near clipping plane begins to move forward into > the scene. I have "autocenter" turned off, and the forward > progression of the near clipping plane seems to be related to the > distance of the sphere from the scene." > > I wrote a similar-sounding program, which seems to behave properly: > > box(color=color.cyan) > s = sphere(pos=(0,0,100), color=color.red) > dz = -1 > ##scene.autocenter = 0 > ##scene.autoscale = 0 > while 1: > rate(20) > s.pos += vector(0,0,dz) > if s.pos.z < 1: > dz = -dz > > Turning off autocenter doesn't do anything that I can see. With the > default autoscale on, the camera is moved to make sure that you always > see something. I'm not sure what you want to have happen, but it sounds > to me like you should turn off autoscaling and manage the view yourself. > > Bruce Sherwood No, it is a legitimate complaint. For example, run stars with a lot of stars and velocity such that at least a few stars fly away and there is plenty to look at in the middle for a while. Zoom the camera into the scene, and position the camera such that a trail is "in your face". You should be able to see the cross-section of the trail as it is clipped by the near clipping plane. As some of the stars fly away from the cluster, you will notice the plane slowly move further into the scene. Eventually, it will cut deeply into the scene. I just committed a fix for this problem into CVS a few minutes ago. Basically, the new behavior is that system decides if the camera might be located within the scene's bounding box, and if so, sets the near clipping plane distance to a small fixed value. Previously, the distance was set to a fixed multiple of the scaled extent of the scene. A scene whose objects span a volume much larger than the display's viewing volume would have an inappropriately large near clipping plane distance. -Jonathan |