Vector3d nearC(0,0,0 -w);
Vector3d farC(0,0,0-x);
double width = y/2;
double height = z/2;
double angleOfHeight = atan(height/w);
double angleOfWidth = atan(width/w);
double adjustedHeight = tan(angleOfHeight) * x;
double adjustedWidth = tan(angleOfWidth) * x;
nearC[0] - width, nearC[1] - height, nearC[2]
nearC[0] - width, nearC[1] + height, nearC[2]
nearC[0] + width, nearC[1] + height, nearC[2]
nearC[0] + width, nearC[1] - height, nearC[2]
farC[0] - adjustedWidth, farC[1] - adjustedHeight, farC[2]
farC[0] - adjustedWidth, farC[1] + adjustedHeight, farC[2]
farC[0] + adjustedWidth, farC[1] + adjustedHeight, farC[2]
farC[0] + adjustedWidth, farC[1] - adjustedHeight, farC[2]
Above is my frustum in view coordinates. View Matrix is:
0 0 -1 0
0 1 0 -1
1 0 0 -10
0 0 0 1
All of it is right, we have a sheet.
I can't for the life of me figure how to get that frustum in canonical viewing volume. I've run through every perspective projection I could find. Current is this:
s, 0, 0, 0,
0, s, 0, 0,
0, 0, -(f+ne)/(f-ne), 2*f*ne/(f-ne),
0, 0, 1, 0;
double s = 1/tan(angleOfView * 0.5 * M_PI / 180);
I'm missing a step or something, right? Or a few steps?
Sorry to sound so hopeless now, been spinning wheels a while on this.
Any help appreciated.