close


以下參考文章:http://blog.chinaunix.net/space.php?uid=12348673&do=blog&id=2847045

一個結合OpenCV及GL的Blog:http://renren.it/a/JAVAbiancheng/ANT/20101023/55803.html

Freeglut:http://freeglut.sourceforge.net/

 

 

=======================本文開始=================================

最近在實驗Bumblebee2立體視覺,想將Point Cloud繪製在視窗中,但使用OpenGL會遇到無法跳出迴圈的問題。

因此一位學長介紹Freeglut,但剛剛才安裝完成,還沒有試如何使用。這裡紀錄如何安裝Freeglut的方法,以免忘記。

 

以下介紹Freeglut2.6.0的安裝方法:

1. 下載Freeglut2.6.0:http://prdownloads.sourceforge.net/freeglut/freeglut-2.6.0.tar.gz?download

  或至官網下載頁面:http://freeglut.sourceforge.net/index.php#download

2. 下載完將檔案在任意資料夾裡面解壓縮,得到"freeglut-2.6.0"資料夾,以VS2010打開資料夾中的..\freeglut-2.6.0\VisualStudio2008\freeglut.vcproj。

  轉換完成後,會在同一個資料夾內產生release資料夾。

3. 將以下檔案加入各別不同的資料夾內:

  a. 將relesase資料夾內的freeglut.dll複製到C:\Windows\System32;如果是64位元系統則放到:C:\Windows\SysWOW64

  b. 將..\freeglut-2.6.0\include\GL中的所有*.h檔案加入到與gl.h同一個資料夾中:

    預設為C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl

    若為64位元系統,則默認為:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl

  c. 將relesase資料夾內的freeglut.lib複製到與GlU32.Lib相同資料夾中:

    預設為C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib

   若為64位元系統,則默認為:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib

 

以上完成系統配置。

 

4. 測試是否成功:

  開啟一個新主控台專案,將以下程式碼複製上去並執行:

 

#include "stdafx.h"
#include <stdio.h>
#include <Windows.h>
//#include <GL/glut.h>
#include <GL/freeglut.h>
 
 
 
 
int _tmain(int argc, _TCHAR* argv[])
{
	glutInit(&argc,0);
 
    glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH);
 
    glutInitWindowSize(300,300);
 
    glutInitWindowPosition(100,100);
 
    glutCreateWindow("testgl");
    const char* version = (const char*)glGetString(GL_VERSION);
    printf("OpenGL 版本:%s\n", version);
    glutMainLoopEvent();
    return 0;
}
 

 

可正確執行即完成。

 

OpenGL, Bumblebee2, Freeglut


arrow
arrow
    全站熱搜

    台灣論壇小說 發表在 痞客邦 留言(0) 人氣()