Programming/openGL2011. 3. 26. 22:21

VERSION:
Release 3.7, Novermber 22, 1998. 

glut는 현재 최신버전이 무려! 1998년도 제작이다.
이런 이유로 휠마우스 지원이라던가 실질적인 업그레이드가 안되고 있기 때문에 freeglut 라는게 생겨났다. 

[링크 : http://stackoverflow.com/questions/14378/using-the-mouse-scrollwheel-in-glut
[링크 : http://freeglut.sourceforge.net/]
    [링크 : http://www.transmissionzero.co.uk/software/freeglut-devel/] << win32용 라이브러리

'Programming > openGL' 카테고리의 다른 글

openGL tutorial - 태양과 지구 돌리기  (0) 2011.03.29
openGL callback function - GLUT 키보드 / 마우스 입력  (0) 2011.03.28
openGL - glbegin()  (2) 2011.03.25
openGL - glortho()  (4) 2011.03.25
visual Studio에서 openGL 돌리기  (0) 2011.03.16
Posted by 구차니
Programming/openGL2011. 3. 25. 22:23

The Red Book 중 포함된 파일




GL_POINTS
 


GL_LINES


GL_LINE_STRIP


GL_LINE_LOOP


GL_TRIANGLES


GL_TRIANGLE_STRIP


GL_TRIANGLE_FAN


GL_QUADS


GL_QUAD_STRIP


GL_POLYGON


음.. 점 4개로는 티가 안나네 -_-

[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glEnd.xml]
Posted by 구차니
Programming/openGL2011. 3. 25. 22:06
glortho() 함수는 화면상의 좌표축을 설정하는 함수이다.
#include "windows.h"
#include "GL/gl.h"
#include "GL/glut.h"

void display(void)
{
/*  clear all pixels  */
    glClear (GL_COLOR_BUFFER_BIT);
/*  draw white polygon (rectangle) with corners at
 *  (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)  
 */
    glColor3f (1.0, 1.0, 1.0);
    glBegin(GL_POLYGON);
        glVertex3f (0.25, 0.25, 0.0);
        glVertex3f (0.75, 0.25, 0.0);
        glVertex3f (0.75, 0.75, 0.0);
        glVertex3f (0.25, 0.75, 0.0);
    glEnd();
/*  don’t wait!  
 *  start processing buffered OpenGL routines 
 */
    glFlush ();
}
void init (void) 
{
/*  select clearing (background) color       */
    glClearColor (0.0, 0.0, 0.0, 0.0);
/*  initialize viewing values  */
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
/* 
 *  Declare initial window size, position, and display mode
 *  (single buffer and RGBA).  Open window with "hello"
 *  in its title bar.  Call initialization routines.
 *  Register callback function to display graphics.
 *  Enter main loop and process events.
 */
int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize (250, 250); 
    glutInitWindowPosition (100, 100);
    glutCreateWindow ("hello");
    init ();
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;   /* ISO C requires main to return int. */
}

glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); 로 설정할 경우의 결과


glOrtho(0.0, 2.0, 0.0, 2.0, -2.0, 2.0); 로 설정할 경우의 결과

대충 정리하자면, 아래 그림과 같다고 할까나~?!


[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml]

'Programming > openGL' 카테고리의 다른 글

freeglut  (0) 2011.03.26
openGL - glbegin()  (2) 2011.03.25
visual Studio에서 openGL 돌리기  (0) 2011.03.16
윈도우에서 opengl.dll을 찾을 수 없다고 할 경우  (0) 2011.03.15
GLUT(openGL Utility Toolkit) 다운로드 (윈도우)  (0) 2011.03.15
Posted by 구차니
Programming/언어론2011. 3. 25. 21:40
IEEE 754 floating point 표준에 보면은,
float형은 7자리까지는 그 정밀도를 보장할 수 있고, 그 이후로는 부정확하다고 되어 있다.
그리고, double형은 15자리까지 정밀도를 보장할 수 있다고 한다.

[링크 : http://kimstar.pe.kr/blog/172]
[링크 : http://en.wikipedia.org/wiki/Double_precision_floating-point_format

'Programming > 언어론' 카테고리의 다른 글

dangling if-else  (0) 2014.08.13
함수 포인터 (function pointer)  (0) 2010.09.16
type system  (0) 2010.09.15
calling convention(콜링 컨벤션)  (0) 2010.04.17
Posted by 구차니
c언어의 switch - case 문은
switch(val)
{
   case 1:
      break;

   case 2:
   case 3:
     break;

   default:
      break;
}
 
이렇게 구성되는데 반해

visual basic에서는
Select switch val
    case 1
    case 2, 3
    case 4 To 5
    case else
End Select
 
이렇게 구성된다.

[링크 : http://msdn.microsoft.com/ko-kr/library/cy37t14y.aspx]
[링크 : http://msdn.microsoft.com/en-us/library/cy37t14y(v=vs.80).aspx
Posted by 구차니
Programming/openGL2011. 3. 16. 21:55
프로젝트 링커에서는 되도록이면
opengl32.lib glut32.lib glu32.lib 세가지 모두 넣어주는게 속이 편하다.


glut32.dll ->C:\Windows\System32
glut32.lib ->C:\program files\microsoft visual studio 8\vc\platformsdk\lib
glut32.h ->...\vc\platformsdk\include\gl

opengl32.lib glu32.lib glut32.lib

[링크 : http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=220142] 

만약 glu32.lib를 하지 않으면 일부 glu를 사용하는 프로그램에서 다음과 같은 에러가 발생한다.
1>bigtest.obj : error LNK2019: _gluLookAt@72 외부 기호(참조 위치: _gfxInit 함수)에서 확인하지 못했습니다.
1>bigtest.obj : error LNK2019: _gluPerspective@32 외부 기호(참조 위치: _gfxInit 함수)에서 확인하지 못했습니다.
1>bigtest.obj : error LNK2019: _gluOrtho2D@32 외부 기호(참조 위치: _showText 함수)에서 확인하지 못했습니다.
1>C:\Documents and Settings\user\바탕 화면\openGL\openGL\Debug\openGL.exe : fatal error LNK1120: 3개의 확인할 수 없는 외부 참조입니다. 

[링크 : http://thoughtsfrommylife.com/article-748-OpenGL_and_Visual_Studio_Express_2008]
[링크 : http://doctory.egloos.com/10521013]
[링크 : http://www.mrmoen.com/2008/03/30/opengl-with-visual-c-express-edition/]




'Programming > openGL' 카테고리의 다른 글

openGL - glbegin()  (2) 2011.03.25
openGL - glortho()  (4) 2011.03.25
윈도우에서 opengl.dll을 찾을 수 없다고 할 경우  (0) 2011.03.15
GLUT(openGL Utility Toolkit) 다운로드 (윈도우)  (0) 2011.03.15
openGL tutorial  (0) 2011.03.12
Posted by 구차니
Programming/openGL2011. 3. 15. 23:21
"opengl.dll을 찾을 수 없으므로 응용 프로그램을 시작하지 못했습니다."
라는 에러가 발생하면 윈도우에서는 아래와 같이 glut.lib를 링크했을 경우이다.
glut.lib / glut.dll 은 sgi 용이라서 윈도우에서 하려면
glut32.lib / glut32.dll 을 링크해야 한다고 한다.



---
2011.03.16 추가
아마도 위에서는 opengl32.lib를 링킹해주지 않아서 발생한 에러로 추측된다.
자세한 링크 정보와 복사경로는 아래의 문서 참조
2011/03/16 - [Programming/openGL] - visual Studio에서 openGL 돌리기
---

[링크 : http://pcsupport.about.com/od/findbyerrormessage/a/opengl-dll-not-found-missing-error.htm]

'Programming > openGL' 카테고리의 다른 글

openGL - glortho()  (4) 2011.03.25
visual Studio에서 openGL 돌리기  (0) 2011.03.16
GLUT(openGL Utility Toolkit) 다운로드 (윈도우)  (0) 2011.03.15
openGL tutorial  (0) 2011.03.12
openGL, GLU, GLUT 관계  (4) 2011.03.07
Posted by 구차니
Programming/openGL2011. 3. 15. 23:01
필요한 녀석은 glutdll3x.zip 하나이다.
GL/gl.h 나 GL/glu.h 는 OS에 포함되어 있거나 그래픽 카드 벤더에서 제공을 하고 있으므로
그리 신경을 안써도 된다는데, Visual Studio 2008의 경우
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl 경로에 기본적으로 포함을 하고 있다.

그리고
glut.h는 C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL이나
            C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl
glut.lib는 C:\Program Files\Microsoft Visual Studio 9.0\VC\lib 에 복사한다.

[링크: http://www.opengl.org/resources/libraries/glut/glut_downloads.php#windows]
    [링크 : http://www.opengl.org/resources/libraries/glut/glut36.zip]  
    [링크 : http://www.opengl.org/resources/libraries/glut/glutdlls36.zip] << 다운로드
    [링크 : http://www.opengl.org/resources/libraries/glut/glut36data.zip]

    [링크 : http://www.opengl.org/resources/libraries/glut/glut37.zip]
    [링크 : http://www.opengl.org/resources/libraries/glut/glut37data.zip] << 다운로드
    [링크 : http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip]

'Programming > openGL' 카테고리의 다른 글

visual Studio에서 openGL 돌리기  (0) 2011.03.16
윈도우에서 opengl.dll을 찾을 수 없다고 할 경우  (0) 2011.03.15
openGL tutorial  (0) 2011.03.12
openGL, GLU, GLUT 관계  (4) 2011.03.07
openGL - GLUT  (0) 2010.08.26
Posted by 구차니
Programming/openGL2011. 3. 12. 21:39
하아.. 언넝 따라해보면서 습득을 해야지 ㅠ.ㅠ


'Programming > openGL' 카테고리의 다른 글

윈도우에서 opengl.dll을 찾을 수 없다고 할 경우  (0) 2011.03.15
GLUT(openGL Utility Toolkit) 다운로드 (윈도우)  (0) 2011.03.15
openGL, GLU, GLUT 관계  (4) 2011.03.07
openGL - GLUT  (0) 2010.08.26
glBegin() / glEnd()  (3) 2010.08.23
Posted by 구차니
Programming/css2011. 3. 9. 17:07
IE 에서는
body
{
    background-color:#000000;
}
이러면 되는데

크롬에서는
html, body
{
    background-color:#000000;
}
이렇게 해야만 된다 -_-

그리고 이미지 경로도
tr {
    background: transparent url(/shadow-down.gif) no-repeat 0% 100%;
    display: block;
    position: relative;
    width: 828px;
}
/ 의 유무에 따라 크롬에서는 민감하게 작동한다 -_-


'Programming > css' 카테고리의 다른 글

CSS / JS 파일 용량 줄이기  (0) 2015.09.18
css selector  (0) 2015.09.14
css 관련  (4) 2015.09.08
css box model  (0) 2014.05.15
CSS Naked day!  (2) 2009.04.09
Posted by 구차니