摘要: OpenGL
中場(chǎng)景進(jìn)行變換,要經(jīng)歷一些過(guò)程:視圖變換
à
模型變換
à
投影變換,然后到了窗口坐標(biāo)。這幾個(gè)變換開(kāi)始的時(shí)候把我搞很混,這幾天整理一下。
??????
一般書上把這幾個(gè)變換用照相機(jī)類比,其實(shí)每個(gè)變換都是產(chǎn)生著一個(gè)
... 閱讀全文
2006年8月11日 #
2006年6月2日 #
下面這段引文可對(duì)左值、右值加深理解。
參考文獻(xiàn):《ANSI/ISO C++ Professional Programmer's Handbook》
lvalues and rvalues
An object is a contiguous region of storage. An lvalue is an expression that refers to such an object. The original
definition of lvalue referred to an object that can appear on the left-hand side of an assignment. However, const
objects are lvalues that cannot be used in the left-hand side of an assignment. Similarly, an expression that can appear
in the right-hand side of an expression (but not in the left-hand side of an expression) is an rvalue. For example
#include?
<
string
>
using ? namespace ?std;
int & ?f();
void ?func()
{
???? int ?n;
???? char ?buf[ 3 ];
????n? = ? 5 ;? // ?n?is?an?lvalue;?5?is?an?rvalue
????buf[ 0 ]? = ? ' a ' ;? // ?buf[0]?is?an?lvalue,?'a'?is?an?rvalue
???? string ?s1? = ? " a " ,?s2? = ? " b " ,?s3? = ?? " c " ;? // ?"a",?"b",?"c"?are?rvalues
????s1? = ? // ?lvalue
????s2? + s3;? // s2?and?s3?are?lvalues?that?are??implicitly?converted?to?rvalues
????s1? = ? // lvalue
???? string ( " z " );? // temporaries?are?rvalues
???? int ? * ?p? = ? new ? int ;? // p?is?an?lvalue;?'new?int'?is?an?rvalue
????f()? = ? 0 ;? // a?function?call?that?returns?a?reference?is?an?lvalue
?????s1.size();? // otherwise,?a?function?call?is?an?rvalue?expression
}
using ? namespace ?std;
int & ?f();
void ?func()
{
???? int ?n;
???? char ?buf[ 3 ];
????n? = ? 5 ;? // ?n?is?an?lvalue;?5?is?an?rvalue
????buf[ 0 ]? = ? ' a ' ;? // ?buf[0]?is?an?lvalue,?'a'?is?an?rvalue
???? string ?s1? = ? " a " ,?s2? = ? " b " ,?s3? = ?? " c " ;? // ?"a",?"b",?"c"?are?rvalues
????s1? = ? // ?lvalue
????s2? + s3;? // s2?and?s3?are?lvalues?that?are??implicitly?converted?to?rvalues
????s1? = ? // lvalue
???? string ( " z " );? // temporaries?are?rvalues
???? int ? * ?p? = ? new ? int ;? // p?is?an?lvalue;?'new?int'?is?an?rvalue
????f()? = ? 0 ;? // a?function?call?that?returns?a?reference?is?an?lvalue
?????s1.size();? // otherwise,?a?function?call?is?an?rvalue?expression
}
An lvalue can appear in a context that requires an rvalue; in this case, the lvalue is implicitly converted to an rvalue.
An rvalue cannot be converted to an lvalue. Therefore, it is possible to use every lvalue expression in the example as
an rvalue, but not vice versa.
2006年5月30日 #
現(xiàn)在有個(gè)困惑,不知道博客怎么寫。既然是個(gè)專業(yè)性的博客,就不敢再這里亂寫。
對(duì)博客定位的問(wèn)題,我也思考數(shù)日。覺(jué)得博客可以有兩個(gè)分類。
1、. 作為初學(xué)者學(xué)習(xí)的成長(zhǎng)歷程。從hello world開(kāi)始。當(dāng)然,至于最后能將這個(gè)歷程走到哪里,卻不得而知了。更甚者,不知是按部就班,一步一步學(xué),還是心血來(lái)潮,想到哪里學(xué)哪里。
2 、 作為一個(gè)專題性的主題討論。提出一個(gè)問(wèn)題,解決它,再談?wù)摚倪M(jìn)。這樣的一個(gè)好處就是能對(duì)問(wèn)題有清晰的認(rèn)識(shí)和解決問(wèn)題能力的也會(huì)提高。主題來(lái)來(lái)源可以是別人的博客上的subject,平時(shí)遇到的問(wèn)題,解決問(wèn)題時(shí)候出來(lái)的新問(wèn)題等等。
寫博克的形式,我想大致可以以上面兩種。
更關(guān)心的問(wèn)題是,我們?cè)趯懖┛偷倪^(guò)程中能得到什么?即既得利益所得。這也同樣是能否繼續(xù)寫下去的一個(gè)驅(qū)動(dòng)力。
可以得到的,我想可以有:1、能力積累。分析、解決問(wèn)題的能力。
????????????????????2、技術(shù)積累。技術(shù)知識(shí)的擴(kuò)張。
????????????????????????3、代碼積累。算法、編程技巧的積淀。同時(shí)可以為創(chuàng)新作積累。
4、技術(shù)會(huì)友。有朋自遠(yuǎn)方來(lái)...
這是我對(duì)即將開(kāi)張的博客的一些想法,請(qǐng)多多指教。
/---------------------------------------------------------------------------------
時(shí)代有時(shí)代的主題,文章也有自己的主旨。偏離了方向,最終會(huì)被拋棄。
-----------------------------------------------------------------------------------/
對(duì)博客定位的問(wèn)題,我也思考數(shù)日。覺(jué)得博客可以有兩個(gè)分類。
1、. 作為初學(xué)者學(xué)習(xí)的成長(zhǎng)歷程。從hello world開(kāi)始。當(dāng)然,至于最后能將這個(gè)歷程走到哪里,卻不得而知了。更甚者,不知是按部就班,一步一步學(xué),還是心血來(lái)潮,想到哪里學(xué)哪里。
2 、 作為一個(gè)專題性的主題討論。提出一個(gè)問(wèn)題,解決它,再談?wù)摚倪M(jìn)。這樣的一個(gè)好處就是能對(duì)問(wèn)題有清晰的認(rèn)識(shí)和解決問(wèn)題能力的也會(huì)提高。主題來(lái)來(lái)源可以是別人的博客上的subject,平時(shí)遇到的問(wèn)題,解決問(wèn)題時(shí)候出來(lái)的新問(wèn)題等等。
寫博克的形式,我想大致可以以上面兩種。
更關(guān)心的問(wèn)題是,我們?cè)趯懖┛偷倪^(guò)程中能得到什么?即既得利益所得。這也同樣是能否繼續(xù)寫下去的一個(gè)驅(qū)動(dòng)力。
可以得到的,我想可以有:1、能力積累。分析、解決問(wèn)題的能力。
????????????????????2、技術(shù)積累。技術(shù)知識(shí)的擴(kuò)張。
????????????????????????3、代碼積累。算法、編程技巧的積淀。同時(shí)可以為創(chuàng)新作積累。
4、技術(shù)會(huì)友。有朋自遠(yuǎn)方來(lái)...
這是我對(duì)即將開(kāi)張的博客的一些想法,請(qǐng)多多指教。
/---------------------------------------------------------------------------------
時(shí)代有時(shí)代的主題,文章也有自己的主旨。偏離了方向,最終會(huì)被拋棄。
-----------------------------------------------------------------------------------/
2006年5月28日 #
大家好:
??????? 我是TH。來(lái)自杭州,致力于C++和圖形學(xué)等方面。請(qǐng)多多指教。
??????? 我是TH。來(lái)自杭州,致力于C++和圖形學(xué)等方面。請(qǐng)多多指教。


