Bug 1393 : Clipping not implemented in P3D
Last modified: 2010-04-21 15:15




Status:
ASSIGNED
Resolution:
-
Priority:
P2
Severity:
normal

 

Reporter:
bit.craft
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-11-29 14:23
version: processing 1.0.9
sample code:
-----
void setup() {
size(300,300,P3D);
noStroke();
}
void draw() {
// ((PGraphics3D) g).cameraNear = -8; // work around for clipping bug
background(0);
lights();
translate(150, 150, -150); // translate to center
rotateY(frameCount * .01); // rotate around axis
translate(0, 0, 2000); // make sure the sphere passes behind the
camera
sphere(100);
}
-----
When the sphere passes behind the camera it is still projected onto the
viewplane (clipping problem) ...

This bug may have been introduced with revision 5707 of PGraphics3D.java
since the cameraNear hack has been commented out in line 1353:
// cameraNear = -8;

http://dev.processing.org/source/index.cgi/trunk/processing/core/src/processing/core/PGraphics3D.java?rev=5707&r1=5653&r2=5707
Additional Comment #1 From fry 2009-11-29 14:37
Clipping has never been implemented properly for P3D. But I'm scratching my
head because this has been a known issue since the very beginning of the
project, but I can't seem to find a proper reference to it in the bugs db
or in the known issues.. So I guess this will be it.
Additional Comment #2 From fry 2009-11-29 14:38
Though does setting cameraNear back to -8 fix the problem (or at least
improve things) for the time being? Maybe we'll just have to go back to the
hack.
Additional Comment #3 From bit.craft 2009-11-29 14:47
never change a working hack ;-)
Additional Comment #4 From fry 2009-11-29 18:20
Of course not. ;)

But does changing things back work for you?
Additional Comment #5 From bit.craft 2009-11-29 21:10
yes it does, I just checked against revision 0173 (linux build) - once I
uncomment line 1353 in PGraphics3D lthings magically work again...
Additional Comment #6 From fry 2009-11-30 04:50
K, thanks for checking. Switched over for the next release.
Additional Comment #7 From fry 2010-01-28 09:48
*** Bug 1449 has been marked as a duplicate of this bug. ***
Additional Comment #8 From fry 2010-02-02 14:48
*** Bug 1453 has been marked as a duplicate of this bug. ***
Additional Comment #9 From fry 2010-04-21 15:15
*** Bug 1550 has been marked as a duplicate of this bug. ***
This bug is now being tracked here.