Bug 318 : box() uses wrong normal values
Last modified: 2006-05-11 03:11




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P3
Severity:
normal

 

Reporter:
JohnG
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-04-06 11:56
the box() method in PGraphics3 has 4 normals with the wrong sign.

Correct vertex/normal chunk should read:

beginShape(QUADS);

// front
normal(0, 0, -1);
vertex(x1, y1, z1);
vertex(x2, y1, z1);
vertex(x2, y2, z1);
vertex(x1, y2, z1);

// right
normal(1, 0, 0);
vertex(x2, y1, z1);
vertex(x2, y1, z2);
vertex(x2, y2, z2);
vertex(x2, y2, z1);

// back
normal(0, 0, 1);
vertex(x2, y1, z2);
vertex(x1, y1, z2);
vertex(x1, y2, z2);
vertex(x2, y2, z2);

// left
normal(-1, 0, 0);
vertex(x1, y1, z2);
vertex(x1, y1, z1);
vertex(x1, y2, z1);
vertex(x1, y2, z2);

// top
normal(0, -1, 0);
vertex(x1, y1, z2);
vertex(x2, y1, z2);
vertex(x2, y1, z1);
vertex(x1, y1, z1);

// bottom
normal(0, 1, 0);
vertex(x1, y2, z1);
vertex(x2, y2, z1);
vertex(x2, y2, z2);
vertex(x1, y2, z2);

endShape();
Additional Comment #1 From fry 2006-04-17 13:12
hm, i don't think so.. you're sure you have the right coordinate system?
http://processing.org/reference/environment/index.html#Coordinates
Additional Comment #2 From JohnG 2006-05-10 06:39
I was fiddling with the OpenGL system, and changed the glScalef from 1,-1,1
to 1,1,1 and that needed the change, seems counter intuitive that normals
need to change, but I've read there can be issues with normals and scale.

This can probably be closed.