vpWindow(3)
π vpWindow β the vpWindow(3) glow-up β¨
okay bestie, settle in, because this is vpWindow from the Library Functions Manual and she's literally the girl who multiplies your projection matrix by a perspective or orthographic matrix. no cap. π«Ά
πΈ NAME πΈ
vpWindow β multiply the projection matrix by a perspective or orthographic matrix
β¨ SYNOPSIS β¨
#include <volpack.h>
vpResult
vpWindow(vpc, type, left, right, bottom, top, near, far)
vpContext *vpc;
int type;
double left, right;
double bottom, top;
double near, far;
π ARGUMENTS π
vpcβ the VolPack context you got fromvpCreateContext. your girl. your main character. πtypeβ the projection type code. rn it must beVP_PARALLEL, no other options, that's the vibe check. πleftβ coordinate of the left vertical clipping plane.rightβ coordinate of the right vertical clipping plane.bottomβ coordinate of the bottom horizontal clipping plane.topβ coordinate of the top horizontal clipping plane.nearβ coordinate of the near depth clipping plane.farβ coordinate of the far depth clipping plane.
π DESCRIPTION π
so vpWindow is used to multiply the current projection matrix by a perspective or orthographic projection matrix. the new projection matrix gets defined by the coordinates of six clipping planes in the eye coordinate system β peep vpCurrentMatrix(3) if you need the lore. π
the matrix maps the points (left, bottom, near) and (right, top, near) to the lower left and upper right corners of the clipping window. and if you want an alternative way to specify the projection matrix, go see vpWindowPHIGS(3), she's iconic too. π
currently, only orthographic projections are supported. perspective projections will be added in a future release β so don't come for her, she's growing. π±
the matrix for parallel projections is:
A 0 0 D
0 B 0 E
0 0 C F
0 0 0 1
with these formulas, exactly as written:
A = 2 / (right - left)
B = 2 / (top - bottom)
C = 2 / (far - near)
D = (left + right) / (left - right)
E = (bottom + top) / (bottom - top)
F = (near + far) / (near - far)
the matrix is multiplied into the projection matrix, even if the projection matrix is not the current matrix. not me pointing that out twice, but it matters. π
by default, the matrix is post-multiplied (N = N*m where N is the current matrix and m is the argument to vpMultMatrix). the VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplication. π«
and the default window? a parallel projection with left = bottom = near = -0.5, and right = top = far = 0.5. periodt. π
π¦ STATE VARIABLES π¦
the current matrix concatenation parameters can be retrieved with this state variable code (check vpGeti(3) for the deets): VP_CONCAT_MODE.
π₯ ERRORS π₯
the normal return value is VP_OK β that's the slay. π₯° the following error return values are possible tho:
VPERROR_BAD_VALUEβ the clipping plane coordinates are invalid (left >= right, etc.). she said no. πVPERROR_BAD_OPTIONβ thetypeargument is invalid.
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindowPHIGS(3)
this has been VolPack's vpWindow(3) page, bestie β go multiply something cute. mwah. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- Copyright (c) 1995-2008, Stanford University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms