Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : P3D - colors don't look right at surface edges

$
0
0
Actually, I don't think it's related to z-sorting.

Here's some example code. The spere resolution is set to something low to make the issue more apparent. Anyone want to give it a try and tell me if you see the same thing?

  1. float cameraAngle;
  2. float cameraAngleInc;
  3. PShape sphere;

  4. void setup() {
  5.   size(400,400,P3D);
  6.   smooth(8);
  7.   noStroke();
  8.   sphereDetail(10,10);
  9.   sphere = createShape(SPHERE, 150);
  10.   cameraAngle = 0;
  11.   cameraAngleInc = TWO_PI/600;
  12. }

  13. void draw() {
  14.   cameraAngle += cameraAngleInc;
  15.   camera(500*cos(cameraAngle),300,500*sin(cameraAngle),0,0,0,0,-1,0);
  16.   directionalLight(204,204,204,0,-1,0);
  17.   ambientLight(24,24,24);
  18.   background(0);
  19.   shape(sphere);
  20. }

  21. void keyPressed() {
  22.   saveFrame("frame_####.png");
  23. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles