2017-08-14 93 views
1

我編寫了一個程序來顯示一些壓力測量結果。我想使用NURBS進行細節可視化。所以我將其定位於 enter link description here在SharpGL中使用NURBS

我的領域有40x48方格的範圍。所以40行48列。 Z分量(高度)應該是可變的。

但我不明白如何定義

glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &ctrlpoints[0][0][0]); 

// Parameter: 
     // target: 
     //  What the control points represent (e.g. MAP2_VERTEX_3). 
     // 
     // u1: 
     //  Range of the variable 'u'. 
     // 
     // u2: 
     //  Range of the variable 'u. 
     // 
     // ustride: 
     //  Offset between beginning of one control point and the next. 
     // 
     // uorder: 
     //  The degree plus one. 
     // 
     // v1: 
     //  Range of the variable 'v'. 
     // 
     // v2: 
     //  Range of the variable 'v'. 
     // 
     // vstride: 
     //  Offset between beginning of one control point and the next. 
     // 
     // vorder: 
     //  The degree plus one. 
     // 
     // points: 
     //  The data for the points. 

我不知道如何設置參數在我的情況。 例如u1和u2是什麼?或者我的ControlPoints是什麼?

回答

0

在這個環節,你可以找到這些參數的詳細描述:

https://msdn.microsoft.com/en-us/library/windows/desktop/ee872053(v=vs.85).aspx

在你面X方向由下式給出的u-座標和Y方向由下式給出v座標。通常將u1-u2和v1-v2設置爲[0,1]間隔。

表面的順序點之間內插(可以執行線性內插與順序= 1,用順序二次插值= 2等。2或3應當爲您的需求是好的。

有了這個說,恐怕「glMap2f」方法不能準確地代表你的數據,因爲通常「控制點」不在表面上(如下圖所示)

你必須尋找一個算法從點雲內插一個nurbs曲面,然後使用glMap2f和計算出的控制點。

如果你想了解更多關於Nurbs的信息,請查看L. Piegl的「The Nurbs book」

相關問題