2016-06-11 60 views
1

我確定我的瀏覽器沒有損壞,但OpenGL的參考文檔使用非常奇怪和未記錄的矩陣表示,我無法理解。如何理解OpenGL文檔的矩陣?

例如,這樣的:https://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml

說明

glFrustum描述了產生的透視投影的立體矩陣。當前矩陣(見glMatrixMode)是由這個矩陣相乘,結果替換當前矩陣,彷彿glMultMatrix用以下矩陣作爲參數調用:

2 ⁢ nearVal right - left 0 A 0 0 2 ⁢ nearVal top - bottom B 0 0 0 C D 0 0 -1 0 

A = right + left right - left 

B = top + bottom top - bottom 

C = - farVal + nearVal farVal - nearVal 

D = - 2 ⁢ farVal ⁢ nearVal farVal - nearVal 

所以我不能讓「下面的矩陣感「 他們說。它甚至沒有16個值,如果我不得不把它看作線性數組。

這是更難:https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml

實例

如果當前矩陣是C和座標被變換爲V = V⁡0伏⁡1體積⁡2 v⁡3,則當前轉換爲C×v,或者

c ⁡ 0 c ⁡ 4 c ⁡ 8 c ⁡ 12 c ⁡ 1 c ⁡ 5 c ⁡ 9 c ⁡ 13 c ⁡ 2 c ⁡ 6 c ⁡ 10 c ⁡ 14 c ⁡ 3 c ⁡ 7 c ⁡ 11 c ⁡ 15 × v ⁡ 0 v ⁡ 1 v ⁡ 2 v ⁡ 3 
Calling glMultMatrix with an argument of m = m ⁡ 0 m ⁡ 1 ... m ⁡ 15 replaces the current transformation with C × M × v , or 

c ⁡ 0 c ⁡ 4 c ⁡ 8 c ⁡ 12 c ⁡ 1 c ⁡ 5 c ⁡ 9 c ⁡ 13 c ⁡ 2 c ⁡ 6 c ⁡ 10 c ⁡ 14 c ⁡ 3 c ⁡ 7 c ⁡ 11 c ⁡ 15 × m ⁡ 0 m ⁡ 4 m ⁡ 8 m ⁡ 12 m ⁡ 1 m ⁡ 5 m ⁡ 9 m ⁡ 13 m ⁡ 2 m ⁡ 6 m ⁡ 10 m ⁡ 14 m ⁡ 3 m ⁡ 7 m ⁡ 11 m ⁡ 15 × v ⁡ 0 v ⁡ 1 v ⁡ 2 v ⁡ 3 
Where v is represented as a 4 × 1 matrix. 

回答

3

您的瀏覽器是否支持MathML?因爲沒有它會顯示這個無格式的混亂。這是它的外觀在瀏覽器中支持MATHML:

enter image description here

3

你的情況的問題是雙重的:

1:您有不支持MathML的瀏覽器。 OpenGL 2.x文檔makes it clear that this is necessary

2:OpenGL 2.x文檔尚未使用MathJax支持進行更新,MathJax支持隨處啓用MathML。 modern OpenGL 4.x documentation uses this,但只涵蓋核心配置文件的東西。

因此,除了獲得帶有MathML支持的瀏覽器外,沒有真正的解決方案。 Khronos集團明確表示,他們甚至不會在man2頁面中修復錯誤信息,更不用說使用MathJax升級它們了。