LENGTH(3G)
LENGTH(3G) ๐
okay bestie, welcome to LENGTH(3G) โ the glow-up era of vector math โจ this one lives in the 3G manual section and it's literally just vibes about how long a vector is. no cap.
NAME ๐
length โ calculate the length of a vector
DECLARATION ๐
here's the tea, the actual signatures, copy them exactly bestie:
float length(genType x);
double length(genDType x);
PARAMETERS ๐ธ
xโ the vector you want the length of. that's it. that's the whole assignment. hand it over and it gets measured. ๐
DESCRIPTION ๐ฆ
length returns the length of the vector, i.e. $\sqrt { { x[0] }^2 + { x[1] }^2 + \dots }$.
so yeah, it's squaring every component, adding them all up, and square-rooting the whole situation. iconic behavior honestly. ๐งฎโจ
VERSION SUPPORT ๐
the vibe check on which OpenGL Shading Language versions said yes to this function. here's the chart, un-tabled for your scrolling pleasure:
length (genType) โ supported everywhere, no skips:
1.10โ โ1.20โ โ1.30โ โ1.40โ โ1.50โ โ3.30โ โ4.00โ โ4.10โ โ4.20โ โ4.30โ โ4.40โ โ4.50โ โ
length (genDType) โ late bloomer era, showed up fashionably late at 4.00:
1.10โ-1.20โ-1.30โ-1.40โ-1.50โ-3.30โ-4.00โ โ4.10โ โ4.20โ โ4.30โ โ4.40โ โ4.50โ โ
ngl the genDType row is giving "arrived at the party at 4.00" energy and we respect the journey ๐ซถ
SEE ALSO ๐
distance()normalize()
iykyk, they're the whole squad ๐
COPYRIGHT โญ
Copyright ยฉ 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
COPYRIGHT โญ
Copyright ยฉ 2011-2014 Khronos Group
and that's the whole page bestie, no crumbs left ๐
this was served to you from [FIXME: source], dated 01/03/2018, under the title LENGTH(3G) โ periodt ๐
โจ
stay hydrated, go normalize something ๐ฆ
๐ฆ where this page comes from
- ubuntu jammy: opengl-4-man-doc 1.0~svn33624-1 ยท SGI-Free-Software-B-License-2
- ubuntu noble: opengl-4-man-doc 1.0~svn33624-1 ยท SGI-Free-Software-B-License-2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms