vpWindow(3)
π vpWindow(3) π
okay so bestie, welcome to the vpWindow page from the Library Functions Manual β this is the one where we multiply the projection matrix by a perspective or orthographic matrix. it's giving math but make it cute. let's go π¦
β¨ 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, and you get it fromvpCreateContext. your whole little universe lives in here πtypeβ the projection type code. right now? it must beVP_PARALLEL. no cap, that's the only option.leftβ the coordinate of the left vertical clipping plane.rightβ the coordinate of the right vertical clipping plane.bottomβ the coordinate of the bottom horizontal clipping plane.topβ the coordinate of the top horizontal clipping plane.nearβ the coordinate of the near depth clipping plane.farβ the coordinate of the far depth clipping plane.
π DESCRIPTION π
vpWindow is here to multiply the current projection matrix by a perspective or orthographic projection matrix. iconic behavior honestly β¨
the new projection matrix is defined by the coordinates of six clipping planes, all in the eye coordinate system (peep vpCurrentMatrix(3) for that whole situation π). and the way this matrix works? it maps the points (left, bottom, near) and (right, top, near) to the lower left and upper right corners of the clipping window. periodt. π
if you want an alternative means of specifying the projection matrix, go look at vpWindowPHIGS(3). choices, we love them π
real talk though: currently, only orthographic projections are supported. perspective projections will be added in a future release. so don't come for me about perspective yet, it's coming, we're manifesting it π§
the matrix for parallel projections is:
A 0 0 D
0 B 0 E
0 0 C F
0 0 0 1
and the pieces are:
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)
so the matrix is multiplied into the projection matrix β and even if the projection matrix is not the current matrix. yes, that's on purpose, it's just how it is π
by default, the matrix is post-multiplied (N = N*m where N is the current matrix and m is the argument to vpMultMatrix). if you'd rather pre-multiply, the VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplication. your matrix, your rules π
and the default window? it's a parallel projection with left = bottom = near = -0.5, and right = top = far = 0.5. so cozy. so centered. main character energy fr fr π
β STATE VARIABLES β
the current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)):
VP_CONCAT_MODE
that's the whole list bestie, it's a short one π«Ά
π ERRORS π
the normal return value is VP_OK. the following error return values are possible:
VPERROR_BAD_VALUEβ the clipping plane coordinates are invalid (left >= right, etc.). yeah. if your left is chillin' to the right of your right, we have a problem πVPERROR_BAD_OPTIONβ thetypeargument is invalid.
π₯ SEE ALSO π₯
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindowPHIGS(3)
and that's the page!! πβ¨ this little baddie comes to you from VolPack, and yes, she is still vpWindow(3) β slay, go multiply some matrices, ily ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms