vpWindowPHIGS(3)
π vpWindowPHIGS π (from the Library Functions Manual, bestie)
okay so this is the page for vpWindowPHIGS, and ngl it's giving "camera setup but make it PHIGS". let's get into it π
β¨ NAME β¨
vpWindowPHIGS β multiply the projection matrix by a PHIGS viewing matrix π¦
πΈ SYNOPSIS πΈ
#include <volpack.h>
vpResult
vpWindowPHIGS(vpc, vrp, vpn, vup, prp, umin, umax, vmin, vmax, front,
back, projection_type)
vpContext *vpc;
vpVector3 vrp, vpn, vup;
vpVector3 prp;
double umin, umax, vmin, vmax, front, back;
int projection_type;
π«Ά ARGUMENTS π«Ά
vpcβ the VolPack context you got fromvpCreateContext. your main character β¨vrpβ point specifying the view reference point πvpnβ vector specifying the view plane normalvupβ vector specifying the view up vector β¬οΈprpβ point specifying the projection reference point (in view reference coordinates)uminβ left coordinate of the clipping window (in view reference coordinates) β¬ οΈumaxβ right coordinate of the clipping window (in view reference coordinates) β‘οΈvminβ bottom coordinate of the clipping window (in view reference coordinates) β¬οΈvmaxβ top coordinate of the clipping window (in view reference coordinates) β¬οΈfrontβ coordinate of the near depth clipping plane (in view reference coordinates) π¬backβ coordinate of the far depth clipping plane (in view reference coordinates) π¬projection_typeβ projection type code. rn it must beVP_PARALLEL, no other option, periodt π
π DESCRIPTION π
vpWindowPHIGS multiplies the current projection matrix by a viewing-and-projection matrix that you specify using the PHIGS viewing model. this model is iconic because it bundles the viewpoint, the projection and the clipping parameters into one glow-up. the resulting matrix lands in the projection transformation matrix. and because both the view and the projection live in that one matrix, you normally don't use the view transformation matrix alongside vpWindowPHIGS β set it to the identity, fr fr. also, right now only parallel projections can be specified. if you want a different view specification model, go look at vpWindow(3), she's got her own thing going on β¨
assuming the view transformation matrix is the identity, the matrix that vpWindowPHIGS produces should transform world coordinates into clip coordinates. so here's the whole transformation, step by step, no gatekeeping:
first, the projection plane (aka the view plane) is defined by a point on the plane β the view reference point, vrp β and a vector normal to the plane β the view plane normal, vpn. π«
next, a coordinate system called the view reference coordinate (VRC) system is specified by means of the view plane normal and the view up vector, vup. the origin of VRC coordinates is the view reference point. the basis vectors of VRC coordinates are:
u = v cross n
v = the projection of vup parallel to vpn onto the view plane
n = vpn
this coordinate system is used to specify the direction of projection and the clipping window. the clipping window bounds in the projection plane are given by umin, umax, vmin and vmax. the direction of projection is the vector from the center of the clipping window to the projection reference point (prp), which is also specified in VRC coordinates. finally, the front and back clipping planes are given by n=front and n=back in VRC coordinates. slay π
for a more detailed explanation of this view specification model, see Computer Graphics: Principles and Practice by Foley, vanDam, Feiner and Hughes. π
π STATE VARIABLES π
the current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CONCAT_MODE. π
π ERRORS π
the normal return value is VP_OK. the following error return values are possible:
VPERROR_BAD_VALUEβ the clipping plane coordinates are invalid (umin >= umax, etc.). πVPERROR_BAD_OPTIONβ the type argument is invalid. πVPERROR_SINGULARβ the vectors defining view reference coordinates are not mutually orthogonal, or the projection reference point lies in the view plane. not the vibe, bestie π
heads up: those clipping window bounds have to actually make sense βumin >= umaxand friends will get you aVPERROR_BAD_VALUE, no cap.
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindow(3)
and that's the whole page, bestie π«Ά this one comes to you from the VolPack era of the manual pages β shoutout to VolPack for keeping it iconic, vpWindowPHIGS(3) forever πβ¨
π¦ 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