Tracker: Bugs

7 Clipping planes incorrect (was: Can't move light source) - ID: 208133
Last Update: Comment added ( dscherer )

I'm sure you already knew that. Here's a case where I wanted to...

I set scene.fov = 0.001 to get a 2-D view. This works--except things higher than about range*2 are invisible because the light is below them. They become visible when the window is rotated. It'd be nice to be able to put the light way out by the camera, to illuminate everything from the top.

Code to show this effect (the Z-axis line will only go up to about 120, but if you rotate the view 90 degrees around the Y axis you can see it grow out to 300).

def text(x,y,z,t):
global labels
labels.append(sphere(pos=(x,y,z),radius=0.0001,label=str(t)))

def DrawLabels():
text(45,-5,0,'Off (msec)')
text(-10,50,0,'On')
text(-10,-10,0,'0 sec')
text(-10,-10,5,'time')
text(-10,-10,100,'100 s')
text(-10,-10,200,'200 s')
text(-10,-10,300,'3...s')

def InitVisual():
scene.width = 500
scene.height = 500
scene.autoscale = 0
scene.fov = 0.001
scene.center = (50,50,0)
scene.range = (60,60,60)
curve(pos=[(100,0,0),(0,0,0),(0,100,0)], color=color.white)
curve(pos=[(0,0,0),(0,0,300)], color=color.white)
DrawLabels()


Chris Phoenix ( cphoenix ) - 2000-06-22 23:25:27 PDT

7

Closed

Fixed

David Scherer

visual quality

feature request

Public


Comments ( 2 )




Date: 2000-06-24 19:33:40 PDT
Sender: dschererProject Admin

Fixed in CVS. I think. Could use some more testing, e.g. with highly
nonuniform graphs.

The far clipping plane should always be adequately distant now. But we can
still hit problems with the *near* plane in scenes with high dynamic range.
Maybe Visual should use the Aleph engine's approach to choosing clipping
planes (give the near plane priority)?


Date: 2000-06-23 06:10:14 PDT
Sender: dschererProject Admin

Good guess, but this problem doesn't actually have anything to do with the
lights, which are infinitely far away.

The problem is that in order to use hardware depth buffering, Visual needs
to choose appropriate near and far clipping planes - essentially, the
distance of the nearest and farthest objects from the camera. Rather than
make a pass through the scene database just to calculate that, it tries to
use the extent information calculated by autoscale. Unfortunately, when
autoscale is off this doesn't work. A temporary workaround is to remove
the lines 'scene.autoscale=0' and 'scene.range=(60,60,60)' and zoom
manually with the mouse.

This is a real bug - we should use the results of the autoscale extent
calculation even when range has been set manually. I've run into this
myself, and should have fixed it by now.

It would also be nice to be able to move the lights, of course.


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 6 )

Field Old Value Date By
status_id Open 2000-06-24 19:33:40 PDT dscherer
resolution_id None 2000-06-24 19:33:40 PDT dscherer
close_date - 2000-06-24 19:33:40 PDT dscherer
priority 5 2000-06-23 06:10:14 PDT dscherer
assigned_to nobody 2000-06-23 06:10:14 PDT dscherer
summary Can't move light source 2000-06-23 06:10:14 PDT dscherer