ortho() + directionalLight = weird behavior. Am I missing something?

edited January 2014 in Questions about Code

It looks like the light normals are behaving incorrectly.

void setup()
{
  size(500,500,P3D);
}

void draw()
{
  background(0);
  ortho();
  translate(width/2,height/2);
  rotateY(2.0 * PI / 360.0 * frameCount);
  rotateX(PI/6);
  directionalLight(255,255,255,.3,-.6,-1);
  box(100);
}

transforming directionallights works fine in perspective mode, though.

as i play around with it it seems that there's some bounding volume for proper light behavior.

My workaround is to simulate ortho with a tiny-FOV perspective, but that'll probably fail to be pixel-perfect.

Answers

Sign In or Register to comment.