檢視原始碼 glu (wx v2.4.3)

OpenGL 的 Erlang 包裝函式

標準 OpenGL API

此文件簡述了完整的 OpenGL 參考頁面中的函式。

摘要

函式

glu:build1DMipmapLevels/9 建構一個遞減解析度的一維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:build1DMipmaps/6 建構一系列遞減解析度的一維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:build2DMipmapLevels/10 建構一個遞減解析度的二維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:build2DMipmaps/7 建構一系列遞減解析度的二維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:build3DMipmapLevels/11 建構一個遞減解析度的三維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:build3DMipmaps/8 建構一系列遞減解析度的三維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

glu:checkExtension/2 如果支援 ExtName 則傳回 ?GLU_TRUE,否則傳回 ?GLU_FALSE

glu:cylinder/6 繪製一個沿著 z 軸方向的圓柱體。圓柱體的底部放置在 z = 0,頂部放置在 z=height。像球體一樣,圓柱體沿著 z 軸細分為切片,沿著 z 軸細分為堆疊。

glu:deleteQuadric/1 銷毀四邊形物件(使用 glu:newQuadric/0 建立),並釋放它使用的任何記憶體。一旦呼叫了 glu:deleteQuadric/1,就不能再次使用 Quad

glu:disk/5z = 0 平面上渲染一個圓盤。圓盤的半徑為 Outer,並包含一個半徑為 Inner 的同心圓孔。如果 Inner 為 0,則不會產生孔。圓盤沿著 z 軸細分為切片(如披薩切片),並沿著 z 軸細分為環(分別由 SlicesLoops 指定)。

glu:errorString/1 從 GL 或 GLU 錯誤碼產生一個錯誤字串。該字串為 ISO Latin 1 格式。例如,glu:errorString/1(?GLU_OUT_OF_MEMORY) 會傳回字串 out of memory

glu:getString/1 傳回一個指向靜態字串的指標,該字串描述了支援的 GLU 版本或 GLU 擴充功能。

glu:lookAt/9 建立一個由眼睛點、指示場景中心的參考點和 UP 向量導出的檢視矩陣。

glu:newQuadric/0 建立並傳回一個指向新的四邊形物件的指標。當呼叫四邊形渲染和控制函式時,必須參考此物件。傳回值 0 表示沒有足夠的記憶體來配置物件。

glu:ortho2D/4 設定一個二維正交檢視區域。這相當於呼叫 gl:ortho/6,其中 near=-1 和 far=1。

glu:partialDisk/7 在 z=0 平面上渲染一個部分圓盤。部分圓盤類似於完整圓盤,只是僅包含從 StartStart + Sweep 的圓盤子集(其中 0 度沿著 +f2yf 軸,90 度沿著 +x 軸,180 度沿著 -y 軸,270 度沿著 -x 軸)。

glu:perspective/4 指定一個進入世界坐標系的檢視視錐。一般來說,glu:perspective/4 中的長寬比應該與相關視埠的長寬比相符。例如,長寬比 = 2.0 表示檢視者的視角在 x 方向上是在 y 方向上的兩倍寬。如果視埠的寬度是其高度的兩倍,則它會顯示沒有失真的影像。

glu:pickMatrix/5 建立一個投影矩陣,可用於將繪圖限制為視埠的一小區域。這通常對於確定正在游標附近繪製哪些物件很有用。使用 glu:pickMatrix/5 將繪圖限制在游標周圍的小區域。然後,進入選取模式(使用 gl:renderMode/1)並重新渲染場景。所有本應在游標附近繪製的圖元都會被識別並儲存在選取緩衝區中。

glu:project/6 使用 ModelProjView 將指定的物件坐標轉換為視窗坐標。結果會儲存在 WinXWinYWinZ 中。傳回值 ?GLU_TRUE 表示成功,傳回值 ?GLU_FALSE 表示失敗。

glu:quadricDrawStyle/2 指定使用 Quad 渲染的四邊形的繪圖樣式。合法值如下:

glu:quadricNormals/2 指定使用 Quad 渲染的四邊形所需的法線類型。合法值如下:

glu:quadricOrientation/2 指定使用 Quad 渲染的四邊形所需的方向類型。Orientation 值如下:

glu:quadricTexture/2 指定是否應為使用 Quad 渲染的四邊形產生紋理坐標。如果 Texture 的值為 ?GLU_TRUE,則會產生紋理坐標;如果 Texture?GLU_FALSE,則不會產生紋理坐標。初始值為 ?GLU_FALSE

glu:scaleImage/9 使用適當的像素儲存模式來縮放像素影像,以從來源影像解壓縮資料並將資料壓縮到目標影像中。

glu:sphere/4 繪製一個以原點為中心、給定半徑的球體。球體沿著 z 軸細分為切片,沿著 z 軸細分為堆疊(類似於經度和緯度線)。

將多邊形三角化,多邊形由一個 Normal 和一個頂點位置列表 Vs 指定。

glu:unProject/6 使用 ModelProjView 將指定的視窗坐標對應到物件坐標。結果會儲存在 ObjXObjYObjZ 中。傳回值 ?GLU_TRUE 表示成功;傳回值 ?GLU_FALSE 表示失敗。

型別

-type enum() :: non_neg_integer().
-type f() :: float().
-type i() :: integer().
-type m12() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.
-type m16() :: {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}.
-type matrix() :: m12() | m16().
-type mem() :: binary() | tuple().
-type vertex() :: {float(), float(), float()}.

函式

連結到此函式

build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data)

檢視原始碼
-spec build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data) -> i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build1DMipmapLevels/9 建構一個遞減解析度的一維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data)

檢視原始碼
-spec build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build1DMipmaps/6 建構一系列遞減解析度的一維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data)

檢視原始碼
-spec build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data) ->
                             i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Height :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build2DMipmapLevels/10 建構一個遞減解析度的二維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data)

檢視原始碼
-spec build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Height :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build2DMipmaps/7 建構一系列遞減解析度的二維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max, Data)

檢視原始碼
-spec build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max,
                          Data) ->
                             i()
                             when
                                 Target :: enum(),
                                 InternalFormat :: i(),
                                 Width :: i(),
                                 Height :: i(),
                                 Depth :: i(),
                                 Format :: enum(),
                                 Type :: enum(),
                                 Level :: i(),
                                 Base :: i(),
                                 Max :: i(),
                                 Data :: binary().

glu:build3DMipmapLevels/11 建構一個遞減解析度的三維紋理貼圖的預先篩選子集,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data)

檢視原始碼
-spec build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data) -> i()
                        when
                            Target :: enum(),
                            InternalFormat :: i(),
                            Width :: i(),
                            Height :: i(),
                            Depth :: i(),
                            Format :: enum(),
                            Type :: enum(),
                            Data :: binary().

glu:build3DMipmaps/8 建構一系列遞減解析度的三維紋理貼圖的預先篩選,稱為 mipmap。這用於紋理貼圖圖元的反鋸齒。

外部文件。

連結到此函式

checkExtension(ExtName, ExtString)

檢視原始碼
-spec checkExtension(ExtName :: string(), ExtString :: string()) -> 0 | 1.

glu:checkExtension/2 如果支援 ExtName 則傳回 ?GLU_TRUE,否則傳回 ?GLU_FALSE

外部文件。

連結到此函式

cylinder(Quad, Base, Top, Height, Slices, Stacks)

檢視原始碼
-spec cylinder(Quad :: i(), Base :: f(), Top :: f(), Height :: f(), Slices :: i(), Stacks :: i()) -> ok.

glu:cylinder/6 繪製一個沿著 z 軸方向的圓柱體。圓柱體的底部放置在 z = 0,頂部放置在 z=height。像球體一樣,圓柱體沿著 z 軸細分為切片,沿著 z 軸細分為堆疊。

外部文件。

-spec deleteQuadric(Quad :: i()) -> ok.

glu:deleteQuadric/1 銷毀四邊形物件(使用 glu:newQuadric/0 建立),並釋放它使用的任何記憶體。一旦呼叫了 glu:deleteQuadric/1,就不能再次使用 Quad

外部文件。

連結到此函式

disk(Quad, Inner, Outer, Slices, Loops)

檢視原始碼
-spec disk(Quad :: i(), Inner :: f(), Outer :: f(), Slices :: i(), Loops :: i()) -> ok.

glu:disk/5z = 0 平面上渲染一個圓盤。圓盤的半徑為 Outer,並包含一個半徑為 Inner 的同心圓孔。如果 Inner 為 0,則不會產生孔。圓盤沿著 z 軸細分為切片(如披薩切片),並沿著 z 軸細分為環(分別由 SlicesLoops 指定)。

外部文件。

-spec errorString(Error :: enum()) -> string().

glu:errorString/1 從 GL 或 GLU 錯誤碼產生一個錯誤字串。該字串為 ISO Latin 1 格式。例如,glu:errorString/1(?GLU_OUT_OF_MEMORY) 會傳回字串 out of memory

外部文件。

-spec getString(Name :: enum()) -> string().

glu:getString/1 傳回一個指向靜態字串的指標,該字串描述了支援的 GLU 版本或 GLU 擴充功能。

外部文件。

連結到此函式

lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ)

檢視原始碼
-spec lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ) -> ok
                when
                    EyeX :: f(),
                    EyeY :: f(),
                    EyeZ :: f(),
                    CenterX :: f(),
                    CenterY :: f(),
                    CenterZ :: f(),
                    UpX :: f(),
                    UpY :: f(),
                    UpZ :: f().

glu:lookAt/9 建立一個由眼睛點、指示場景中心的參考點和 UP 向量導出的檢視矩陣。

外部文件。

-spec newQuadric() -> i().

glu:newQuadric/0 建立並傳回一個指向新的四邊形物件的指標。當呼叫四邊形渲染和控制函式時,必須參考此物件。傳回值 0 表示沒有足夠的記憶體來配置物件。

外部文件。

連結到此函式

ortho2D(Left, Right, Bottom, Top)

檢視原始碼
-spec ortho2D(Left :: f(), Right :: f(), Bottom :: f(), Top :: f()) -> ok.

glu:ortho2D/4 設定一個二維正交檢視區域。這相當於呼叫 gl:ortho/6,其中 near=-1 和 far=1。

外部文件。

連結到此函式

partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep)

檢視原始碼
-spec partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep) -> ok
                     when
                         Quad :: i(),
                         Inner :: f(),
                         Outer :: f(),
                         Slices :: i(),
                         Loops :: i(),
                         Start :: f(),
                         Sweep :: f().

glu:partialDisk/7 在 z=0 平面上渲染一個部分圓盤。部分圓盤類似於完整圓盤,只是僅包含從 StartStart + Sweep 的圓盤子集(其中 0 度沿著 +f2yf 軸,90 度沿著 +x 軸,180 度沿著 -y 軸,270 度沿著 -x 軸)。

外部文件。

連結到此函式

perspective(Fovy, Aspect, ZNear, ZFar)

檢視原始碼
-spec perspective(Fovy :: f(), Aspect :: f(), ZNear :: f(), ZFar :: f()) -> ok.

glu:perspective/4 指定一個進入世界坐標系的檢視視錐。一般來說,glu:perspective/4 中的長寬比應該與相關視埠的長寬比相符。例如,長寬比 = 2.0 表示檢視者的視角在 x 方向上是在 y 方向上的兩倍寬。如果視埠的寬度是其高度的兩倍,則它會顯示沒有失真的影像。

外部文件。

連結到此函式

pickMatrix(X, Y, DelX, DelY, Viewport)

檢視原始碼
-spec pickMatrix(X :: f(), Y :: f(), DelX :: f(), DelY :: f(), Viewport :: {i(), i(), i(), i()}) -> ok.

glu:pickMatrix/5 建立一個投影矩陣,可用於將繪圖限制為視埠的一小區域。這通常對於確定正在游標附近繪製哪些物件很有用。使用 glu:pickMatrix/5 將繪圖限制在游標周圍的小區域。然後,進入選取模式(使用 gl:renderMode/1)並重新渲染場景。所有本應在游標附近繪製的圖元都會被識別並儲存在選取緩衝區中。

外部文件。

連結到此函式

project(ObjX, ObjY, ObjZ, Model, Proj, View)

檢視原始碼
-spec project(ObjX, ObjY, ObjZ, Model, Proj, View) -> {i(), WinX :: f(), WinY :: f(), WinZ :: f()}
                 when
                     ObjX :: f(),
                     ObjY :: f(),
                     ObjZ :: f(),
                     Model :: matrix(),
                     Proj :: matrix(),
                     View :: {i(), i(), i(), i()}.

glu:project/6 使用 ModelProjView 將指定的物件坐標轉換為視窗坐標。結果會儲存在 WinXWinYWinZ 中。傳回值 ?GLU_TRUE 表示成功,傳回值 ?GLU_FALSE 表示失敗。

外部文件。

連結到此函式

quadricDrawStyle(Quad, Draw)

檢視原始碼
-spec quadricDrawStyle(Quad :: i(), Draw :: enum()) -> ok.

glu:quadricDrawStyle/2 指定使用 Quad 渲染的四邊形的繪圖樣式。合法值如下:

外部文件。

連結到此函式

quadricNormals(Quad, Normal)

檢視原始碼
-spec quadricNormals(Quad :: i(), Normal :: enum()) -> ok.

glu:quadricNormals/2 指定使用 Quad 渲染的四邊形所需的法線類型。合法值如下:

外部文件。

連結到此函式

quadricOrientation(Quad, Orientation)

檢視原始碼
-spec quadricOrientation(Quad :: i(), Orientation :: enum()) -> ok.

glu:quadricOrientation/2 指定使用 Quad 渲染的四邊形所需的方向類型。Orientation 值如下:

外部文件。

連結到此函式

quadricTexture(Quad, Texture)

檢視原始碼
-spec quadricTexture(Quad :: i(), Texture :: 0 | 1) -> ok.

glu:quadricTexture/2 指定是否應為使用 Quad 渲染的四邊形產生紋理坐標。如果 Texture 的值為 ?GLU_TRUE,則會產生紋理坐標;如果 Texture?GLU_FALSE,則不會產生紋理坐標。初始值為 ?GLU_FALSE

外部文件。

連結到此函式

scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut)

檢視原始碼
-spec scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut) -> i()
                    when
                        Format :: enum(),
                        WIn :: i(),
                        HIn :: i(),
                        TypeIn :: enum(),
                        DataIn :: binary(),
                        WOut :: i(),
                        HOut :: i(),
                        TypeOut :: enum(),
                        DataOut :: mem().

glu:scaleImage/9 使用適當的像素儲存模式來縮放像素影像,以從來源影像解壓縮資料並將資料壓縮到目標影像中。

外部文件。

連結到此函式

sphere(Quad, Radius, Slices, Stacks)

檢視原始碼
-spec sphere(Quad :: i(), Radius :: f(), Slices :: i(), Stacks :: i()) -> ok.

glu:sphere/4 繪製一個以原點為中心、給定半徑的球體。球體沿著 z 軸細分為切片,沿著 z 軸細分為堆疊(類似於經度和緯度線)。

外部文件。

-spec tesselate(Normal, [Vs]) -> {Triangles, VertexPos}
                   when
                       Normal :: vertex(),
                       Vs :: vertex(),
                       Triangles :: [integer()],
                       VertexPos :: binary().

將多邊形三角化,多邊形由一個 Normal 和一個頂點位置列表 Vs 指定。

該函式會傳回頂點的索引列表和一個二進制(64 位元原生浮點數),其中包含頂點位置陣列,它以 Vs 中的頂點開頭,並可能在末尾包含新建立的頂點。

連結到此函式

unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal)

檢視原始碼
-spec unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal) ->
                    {i(), ObjX :: f(), ObjY :: f(), ObjZ :: f(), ObjW :: f()}
                    when
                        WinX :: f(),
                        WinY :: f(),
                        WinZ :: f(),
                        ClipW :: f(),
                        Model :: matrix(),
                        Proj :: matrix(),
                        View :: {i(), i(), i(), i()},
                        NearVal :: f(),
                        FarVal :: f().

glu:unProject/6 使用 ModelProjView 將指定的視窗坐標對應到物件坐標。結果會儲存在 ObjXObjYObjZ 中。傳回值 ?GLU_TRUE 表示成功;傳回值 ?GLU_FALSE 表示失敗。

外部文件。

連結到此函式

unProject(WinX, WinY, WinZ, Model, Proj, View)

檢視原始碼
-spec unProject(WinX, WinY, WinZ, Model, Proj, View) -> {i(), ObjX :: f(), ObjY :: f(), ObjZ :: f()}
                   when
                       WinX :: f(),
                       WinY :: f(),
                       WinZ :: f(),
                       Model :: matrix(),
                       Proj :: matrix(),
                       View :: {i(), i(), i(), i()}.

unProject4/9 等效。