2018年1月15日 星期一
2018年1月13日 星期六
WEEK11 計算機圖學
processing 3 播mp3音樂
下載Minim libraries
程式碼 :
import dff.minim.*;
Minim minim;
AudioPlayer player;
void setup(){
minim = new Minim(this);
player = minim.loadFile("檔名");
player.play();
}
下載Minim libraries
程式碼 :
import dff.minim.*;
Minim minim;
AudioPlayer player;
void setup(){
minim = new Minim(this);
player = minim.loadFile("檔名");
player.play();
}
計算機圖學 WEEK10
1. 觀看SIGGRAPH 影片
2.用processing寫Android程式碼
processing更改mode方式 : 右上角點添加模式,選android
接下來的程式碼即可在手機上投影
2.用processing寫Android程式碼
processing更改mode方式 : 右上角點添加模式,選android
接下來的程式碼即可在手機上投影
2017年11月30日 星期四
計算機WEEK12
1.下載老師的myfunc檔(在上課軟體裡)
2.複製程式碼至GLUT專案
並更改int main(int argc,char **argv)
及新增glutInit(&argc,argv);
2.複製程式碼至GLUT專案
並更改int main(int argc,char **argv)
及新增glutInit(&argc,argv);
也要更改setting裡compiler 把第二個勾勾取消掉
並且reboot
2017年11月9日 星期四
2017年11月8日 星期三
Allen Week8
從moodle上下載 opencv-2.1.0-win32-vs2008.exe
Install option記得勾選第三個
開啟 Console application 專案
設定好路徑
並且下載 moodle上 week08-3earth.zip
路競設定好
即可完成
Install option記得勾選第三個
開啟 Console application 專案
設定好路徑
並且下載 moodle上 week08-3earth.zip
路競設定好
即可完成
瑋倫WEEK7
Lighting打光
void motion(int x,int y)
{
light_position[0]= (x-150)/150.0*2;
light_position[1]=-(y-150)/150.0*2;
glLightfv(GL_LIGHT0,GL_POSITION,light_position);
glutPostRedisplay();
}
滑鼠可改變光源
2017年10月19日 星期四
瑋倫的WEEK6筆記
1.從moodle上課軟體下在week5.zip 會發現transformation無法編譯
從setting 案compiler 把勾勾勾除 即可編譯
從setting 案compiler 把勾勾勾除 即可編譯
2.打光lighting
在createwindow 跟 mainloop中間插入程式碼
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, pos);
即可產生打光效果(PS 外面記得加GLFLOAT
)
2017年10月14日 星期六
WEEK05 瑋倫的圖學
到jsyeh.org/3dcg10的,下載win32、data、glut32.dll三個檔案,解壓縮後打開Transformation.exe
或開projection.exe
gluOrtho (左, 右, 下, 上, 近, 遠)
glFrustum (左, 右, 下, 上, 近, 遠)
glutLookAt (eyeX, eyeY, eyeZ,
centerX, centerY, centerZ,
upX, upY, upZ)
2017年10月5日 星期四
2017年10月1日 星期日
瑋倫的WEEK3筆記
製作3D足球
從jsyeh.org/3dcg10 下載data
裡有soccerball
接下來下載3d exploration
然後打開 把soccerball.obj抓出來
save as .cpp檔
要記得改成sample app
然後再code block打開opengl
把soccerball的cpp程式碼複製到opengl project
從jsyeh.org/3dcg10 下載data
裡有soccerball
接下來下載3d exploration
然後打開 把soccerball.obj抓出來
save as .cpp檔
要記得改成sample app
然後再code block打開opengl
把soccerball的cpp程式碼複製到opengl project
2017年9月21日 星期四
瑋倫的點線面筆記
1.打開GLUT專案
2.複製部分程式碼(可用notepad++編輯)
#include <GL/glut.h>
void display()
{
glClearColor(1,0,0,0); //清背景顏色 (R,G,B,A) ex:紅1000
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1,1,1);
//3是3個參數,f是0.0-1.0之間的浮點數
glutSolidTeapot(0.3); //茶壺 glut外掛
glutSwapBuffers(); //交換繪圖Buffers
}
int main(int argc, char *argv[]) //主程式函式,吃argc參數數量,argv是參數的全部,用陣列存
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); //設定顯示模式
glutCreateWindow("GLUT Shapes");
glutDisplayFunc(display);
glutMainLoop(); //主要迴圈
}
2.複製部分程式碼(可用notepad++編輯)
#include <GL/glut.h>
void display()
{
glClearColor(1,0,0,0); //清背景顏色 (R,G,B,A) ex:紅1000
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1,1,1);
//3是3個參數,f是0.0-1.0之間的浮點數
glutSolidTeapot(0.3); //茶壺 glut外掛
glutSwapBuffers(); //交換繪圖Buffers
}
int main(int argc, char *argv[]) //主程式函式,吃argc參數數量,argv是參數的全部,用陣列存
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); //設定顯示模式
glutCreateWindow("GLUT Shapes");
glutDisplayFunc(display);
glutMainLoop(); //主要迴圈
}
3.做三角形程式碼
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_POLYGON); //開始畫(多邊形)
//彩色三角形在頂點前用函式glColor3f(R,G,B);
glColor3f(1,0,0); glVertex3f(1,1,0); //三個頂點 前面為設定顏色
glColor3f(0,1,0); glVertex3f(-1,1,0);
glColor3f(0,0,1); glVertex3f(0,-1,0);
glEnd(); //結束畫
glutSwapBuffers();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("GLUT Shapes");
glutDisplayFunc(display);
glutMainLoop();
}
2017年9月14日 星期四
訂閱:
文章 (Atom)





