(一)主題介紹: 元智3D漫遊 加上光線
透過設定
float light_diffuse[4] = {1.0, 1.0, 1.0, 1.0}; //散射光
float light_ambient[4] = {1.0, 1.0, 1.0, 1.0}; //環境光
float light_specular[4] = {0.5, 0.5, 0.5, 1.0}; //全反射光
float light_position[4] = { 0 , 100, 0, 1.0 }; //位置
來調整,然後把光源放在正上方往下照射
(二)過程與成就展示
(三)使用到的函式:
GLMmodel *glm_model[16];
glm_model[0]= glmReadOBJ( "build.obj" );
glmUnitize( glm_model[0] );
glmScale( glm_model[0], 10 );
glmFacetNormals( glm_model[0] );
glmVertexNormals( glm_model[0], 90 );
使用這項函式來load model
在此之前要先建模,我是使用autodesk 3ds max 2013來建
最後export .obj檔在匯入
(四)心得
在建模上面的模型跟在glut內差很多,不管是顏色、形狀等等
這次六館很奇怪,明明模型上面有的東西,放到glut上卻甚麼都沒有...
可是我也無能為力,就只能當成一個缺憾摟
這次顏色也搭的不是很好,不曉得是光線問題還是建模要注意甚麼...
看來還是要多練習才行
沒有留言:
張貼留言