2018年1月11日 星期四
2017年12月21日 星期四
ㄅㄏ的OpenGL_glut_Week_15
Anti-Aliasing(AA)
中文翻譯作反鋸齒
1. 因為取樣頻率過低或不足造成圖像的失真 看起來就像有鋸齒 波浪等形狀(Aliasing)
2. 可用許多Anti-Aliasing技術來修正
Dither 抖動
是在數位訊號處理領域的中一項用於降低量化誤差的技術。抖動常用於音影片處理,且是CD壓制過程的最後一步。經過抖動處理過的音樂,將聽起來更柔順、背景更黑;而經過抖動處理過的影像,也會更加地柔順耐看。
抖動最重要的用途之一是將灰階圖像轉為黑白。通過使用抖動演算法,可以令黑白圖案的黑點密度接近原圖案的大致灰度。 ( FROM WIKI)
中文翻譯作反鋸齒
1. 因為取樣頻率過低或不足造成圖像的失真 看起來就像有鋸齒 波浪等形狀(Aliasing)
2. 可用許多Anti-Aliasing技術來修正
Dither 抖動
是在數位訊號處理領域的中一項用於降低量化誤差的技術。抖動常用於音影片處理,且是CD壓制過程的最後一步。經過抖動處理過的音樂,將聽起來更柔順、背景更黑;而經過抖動處理過的影像,也會更加地柔順耐看。
抖動最重要的用途之一是將灰階圖像轉為黑白。通過使用抖動演算法,可以令黑白圖案的黑點密度接近原圖案的大致灰度。 ( FROM WIKI)
ㄅㄏ的OpenGL_glut_Week_10
1.
SIGGRAPH 期末作品可參考
...等介紹
2.
Processing 新增Android模式即可寫APP
可連接手機直接進行測試
程式寫法和之前很像
void draw()
{...}
void mouseDragged()
{...}
...
..
之類的
SIGGRAPH 期末作品可參考
...等介紹
2.
Processing 新增Android模式即可寫APP
可連接手機直接進行測試
程式寫法和之前很像
void draw()
{...}
void mouseDragged()
{...}
...
..
之類的
ㄅㄏ的OpenGL_glut_Week_13
1. AR體驗
2.
colorMode( );
RGB => 紅綠藍
HSB => 彩度飽和度亮度
void setup(){
size(255,255);
colorMode(RGB);
}
void draw(){
for(int x=0;x<=255;x++){
for(int y=0;y<=255;y++){
stroke(x,mouseX,mouseY); ///stroke(x,y,255); //色階 飽和度 亮度
point(x,y);
}
}
}
2.
colorMode( );
RGB => 紅綠藍
HSB => 彩度飽和度亮度
void setup(){
size(255,255);
colorMode(RGB);
}
void draw(){
for(int x=0;x<=255;x++){
for(int y=0;y<=255;y++){
stroke(x,mouseX,mouseY); ///stroke(x,y,255); //色階 飽和度 亮度
point(x,y);
}
}
}
光劍暈開的感覺
色彩變化曲線 => 色彩固定,飽和度中間不飽和,兩側飽和)
2017年11月30日 星期四
2017年11月23日 星期四
ㄅㄏ的OpenGL_glut_Week_11
mmsystem.h中
PlaySoundA("file.wav", NULL, SND_SYNC);
來播放wav檔
一般來說檔案放在同目錄底下
使用glut時 檔案放在glut的bin裡 或是自己定義路徑
使用"CMP3_MCI.h" 建立 CMP3_MCI 物件來播放mp3檔
#include <GL/glut.h>
#include <stdlib.h>
#include "CMP3_MCI.h"
CMP3_MCI mp3;
int main()
{
mp3.Load("file.mp3");///讀入 mp3檔
mp3.Play();///Play播放mp3檔
///PlaySoundA("file.wav", NULL, SND_SYNC);
printf("現在在待輸入a\n");
int a;
scanf("%d", &a);///等待輸入時,程式還沒結束
}
Processing:
使用Minim
import ddf.minim.*;
Minim minim;
AudioPlayer player;
AudioPlayer player2;
void setup(){
minim = new Minim(this);
player = minim.loadFile("xxx.mp3");
player.play();
}
void draw(){
}
2017年10月26日 星期四
2017年10月19日 星期四
ㄅㄏ的OpenGL_glut_Week_06
1. 下載week05的進度 編譯

2. 在程式裡加上
GLfloat pos[]={ 0.0 , 0.0 , -1.0 , 0.0 }; 視點(?
glEnable(GL_DEPTH_TEST); 開啟深度 這樣才有遠近
glEnable(GL_LIGHT0); 開啟光線0
glEnable(GL_LIGHTING); 開啟光線
glLightfv(GL_LIGHT0,GL_POSITION,pos); 設定光線
編譯

3. 在程式中加上

void keyboard(unsigned char k,int x,int y)
{
printf("%c %d %d\n",k,x,y);
}
void mouse(int button,int state,int x,int y)
{
printf("%d %d %d %d\n",button,state,x,y);
}
glutMouseFunc(mouse);
glutKeyboardFunc(keyboard);
輸出可以看到參數

4. 再增加
glutMotionFunc(motion);
跟

就可以用滑鼠控制旋轉了
2. 在程式裡加上
GLfloat pos[]={ 0.0 , 0.0 , -1.0 , 0.0 }; 視點(?
glEnable(GL_DEPTH_TEST); 開啟深度 這樣才有遠近
glEnable(GL_LIGHT0); 開啟光線0
glEnable(GL_LIGHTING); 開啟光線
glLightfv(GL_LIGHT0,GL_POSITION,pos); 設定光線
編譯
3. 在程式中加上
void keyboard(unsigned char k,int x,int y)
{
printf("%c %d %d\n",k,x,y);
}
void mouse(int button,int state,int x,int y)
{
printf("%d %d %d %d\n",button,state,x,y);
}
glutMouseFunc(mouse);
glutKeyboardFunc(keyboard);
輸出可以看到參數
4. 再增加
glutMotionFunc(motion);
跟
就可以用滑鼠控制旋轉了
2017年10月12日 星期四
ㄅㄏ的OpenGL_glut_Week_05
1.到http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/ 下載[data],[win32]和glut32.dll
把data和win32解壓縮後和glut32.dll放在同一個資料夾中

2.執行Transformation.exe
可以用滑鼠調整glTranslatef , glRotatef , glScalef


3.執行Projection.exe

把data和win32解壓縮後和glut32.dll放在同一個資料夾中
2.執行Transformation.exe
可以用滑鼠調整glTranslatef , glRotatef , glScalef
3.執行Projection.exe
透視投影法
gluPerspective(fovy, aspect, zNeer, zFar)
視野, y/x比例
gluLookAt(eyeX, eyeY, eyeZ,
centerX, centerY, centerZ,
upX, upY, upZ)
*eye:改變視角
center:依中心點改變觀看角度
up:旋轉視角
垂直投影法
glOrtho(left, right, bootom, top, near, far)
透視視野
glFrushum(left, right, bottom, top, near, far)
2017年10月5日 星期四
ㄅㄏ的OpenGL_glut_Week_04
2017年9月28日 星期四
ㄅㄏ的OpenGL_glut_Week_03
2017年9月21日 星期四
ㄅㄏ的OpenGL_glut_Week_02
2017年9月14日 星期四
ㄅㄏ的OpenGL_glut_Week_01
訂閱:
文章 (Atom)

