既然我做這樣的事情:GlOrtho矩陣的開羅矩陣equivillant?
void glOrtho( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble nearVal,
GLdouble farVal);
,其結果是:http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml瓦特我能做到這樣的矩陣:
http://cairographics.org/manual/cairo-matrix.html
我嘗試這樣做:
cairo_matrix_t mat;
mat.xx = 2/(right - left);
mat.yx = 0;
mat.xy = 2/(top - bottom);
mat.yy = 0;
mat.x0 = 0;
mat.y0 = 0;
cairo_set_matrix(cr,&mat);
但它沒有奏效。我怎麼能實現GlOrtho在開羅製造的同樣的矩陣? 謝謝
我不知道開羅但它看起來像'cairo_matrix_t'是一個3x3矩陣,而不是像那些OpenGL的一個4x4。如果你的觀點像'(x y 1)'(我不知道開羅),你必須刪除GL矩陣的第三行和第三列,而不是第四個 – Tomaka17 2010-08-28 05:05:15
然後我應該怎麼做才能使它適用於3x3? – jmasterx 2010-08-28 05:07:14
但它只有6個雙打,而不是9個 – jmasterx 2010-08-28 05:14:34