Programming/openGL2010. 8. 23. 22:34
openGL에서 선이나 점, 면을 그릴때에는
 glBegin();
 glEnd();
사이에 값을 넣어준다.

glBegin()과 glEnd()의 프로토타입은 아래와 같으며,
glBegin()의 경우 데이터를 처리할 방법에 대해서 정해준다.
void glBegin(GLenum mode);
    GL_POINTS,
    GL_LINES,
    GL_LINE_STRIP,
    GL_LINE_LOOP,
    GL_TRIANGLES,
    GL_TRIANGLE_STRIP,
    GL_TRIANGLE_FAN,
    GL_QUADS,
    GL_QUAD_STRIP, and
    GL_POLYGON.

void glEnd(void);

Only a subset of GL commands can be used between glBegin and glEnd.
            The commands are
            glVertex, glColor, glSecondaryColor, glIndex, glNormal, glFogCoord, glTexCoord, glMultiTexCoord,
            glVertexAttrib, glEvalCoord, glEvalPoint, glArrayElement, glMaterial, and glEdgeFlag.
            Also, it is acceptable to use glCallList or glCallLists to execute
            display lists that include only the preceding commands.
            If any other GL command is executed between glBegin and glEnd,
            the error flag is set and the command is ignored.

[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml]
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glEnd.xml] glBegin으로 링크 변경됨

아래의 소스처럼 glBegin()과 glEnd() 사이에 값을 넣어주면,
그림처럼 openGL에서 glBegin()의 값을 이용하여 점/선/면을 처리하게 된다.
여기서는 GL_POLYGON 이므로 5개의 점으로 이루어진 하나의 면이 나타나게 된다.
glBegin(GL_POLYGON);
   glVertex2f(0.0, 0.0);
   glVertex2f(0.0, 3.0);
   glVertex2f(3.0, 3.0);
   glVertex2f(4.0, 1.5);
   glVertex2f(3.0, 0.0);
glEnd();


[링크 : http://fly.cc.fer.hr/~unreal/theredbook/chapter02.html]

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

openGL tutorial  (0) 2011.03.12
openGL, GLU, GLUT 관계  (4) 2011.03.07
openGL - GLUT  (0) 2010.08.26
openGL 문서들  (0) 2010.08.22
openGL  (4) 2010.08.18
Posted by 구차니
Programming/Java2010. 8. 23. 21:47
eclipse CDT / code::blocks 를 구축하려고 다운받다가 JDK 에서 netbeans로 넘어오니
유행(?)인 java IDE에서 C/C++을 지원하는 것이 발견되었다.

netbeans는 JFC를 쓸때 참 좋았는데, 이녀석이 CDT를 지원할줄이야!
그래도 용량은 착하지만.. Java SE 지원안하고 C/C++만 되는건 먼가 기형적인디?


[링크 : http://netbeans.org/downloads/index.html]

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

Java 에서 파일 목록 엳어오기  (0) 2011.10.29
netbeans 에서 코드 자동정렬  (0) 2011.10.29
Java용 폴더 다이얼로그  (0) 2011.10.28
unit test - 단위 테스트  (0) 2010.08.18
java에는 unsigned가 없다고?!  (0) 2009.09.03
Posted by 구차니
Programming/openGL2010. 8. 22. 21:42
openGL 에는 책이 두권이 있다.
하나는 빨간책(Red Book) 다른 하나는 파란책(Blue Book)이다.



대부분의 국내서점에서 한글판은 절판이고, 영문판은 6만원에 육박한다.
그리고 버전도 여러가지라서 참으로 헷갈려서, 도무지 어느 녀석을 사야할지 모호하다.

2010.08.22 일 기준으로, openGL은 4.0 까지 나와있으므로
openGL 3.0 을 이야기 하고있는, 7th edition을 구매하면 될 것으로 생각된다.

[도서]
OpenGL 프로그래밍 가이드 : OpenGL 1.2 공식 학습 가이드 (3)
OpenGL 프로그래밍 가이드 : OpenGL 1.4 공식 학습 가이드 (4판)

[외서]
Opengl Programming Guide : The Official Guide To Learning Opengl, Version 2 (Paperback, 5/E)
OpenGL Programming Guide : The Official Guide to Learning OpenGL, Version 2.1 (Paperback, 6th Edition)
Opengl Programming Guide : The Official Guide to Learning OpenGL, Versions 3.0 and 3.1 (Paperback, 7th Edition)

[출처 : www.yes24.com opengl 키워드]

[링크 : http://www.opengl.org/documentation/specs/]
[링크 : http://fly.cc.fer.hr/~unreal/theredbook/]
    [링크 : http://fly.cc.fer.hr/~unreal/theredbook/theredbook.zip] << red book html download
[링크 : http://www.opengl.org/documentation/]
    [링크 : http://alien.dowling.edu/~vassil/theredbook/] << red book
    [링크 : http://alien.dowling.edu/~vassil/thebluebook/] << blue book

2010.08.23 추가
[링크 : http://www.opengl.org/sdk/docs/man/] API manpage

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

openGL tutorial  (0) 2011.03.12
openGL, GLU, GLUT 관계  (4) 2011.03.07
openGL - GLUT  (0) 2010.08.26
glBegin() / glEnd()  (3) 2010.08.23
openGL  (4) 2010.08.18
Posted by 구차니
firefox에는 소스가 Syntax Highlight 되서 나오지만, DOM 트리를 볼수있는 방법은 없다.
다른 툴을 이용할까 했지만, 자바스크립트 for web 2.0 책을 보다보니
DOM Inspector 라는 녀석이 Firefox에 내장되어 있다는 내용이 있었지만,
실제로 최신버전에는 그녀석이 없고, '부가 기능'으로 추가를 해주어야 한다.


아무튼, XML Viewer 와 비슷한 방식으로 HTML DOM을 트리로 출력을 해준다.


2010/01/04 - [파일방] - MiTeC XML Viewer (Free!)
[링크 : https://addons.mozilla.org/ko/firefox/addon/6622/] << 부가기능 페이지
Posted by 구차니
Programming/openGL2010. 8. 18. 20:58
openGL은 windows 계열에서는 DirectX에 밀려 못들어 본 사람도 있을지 모르겠지만
실질적인 산업표준이고, 현재로서는 유알한 cross-platform을 지원하는 3D Library 이다.

서점에 가서 책을보다 보니 이상한 약자들이 많아서 일단 조사 고고싱

openGL                - open Graphic Library
openGL ES             - openGL Embeded System
openGL extension      - openGL 3rd party plugins
GLEW                  - openGL Extension Wrangler Library
GLEE                  - openGL Easy Extension library

GLU                   - openGL Utility library
GLUT                  - openGL Utility Toolkit
GLUI                  - openGL User Interface library
GLX                   - openGL extension to the X window system
GLSL                  - openGL Shading Language

모든것의 원흉(?)은 바로 extension 이었는데,
GLX역시 extention 중의 하나로 X window와 연관된 extension 이고, extension은 plugin이다.

[링크 : http://en.wikipedia.org/wiki/OpenGL]
[링크 : http://en.wikipedia.org/wiki/OpenGL_ES]
[링크 : http://en.wikipedia.org/wiki/OpenGL#Extensions]
[링크 : http://en.wikipedia.org/wiki/OpenGL_Extension_Wrangler_Library]
[링크 : http://en.wikipedia.org/wiki/OpenGL_Easy_Extension_library]

[링크 : http://en.wikipedia.org/wiki/OpenGL_Utility_Library]
[링크 : http://en.wikipedia.org/wiki/OpenGL_Utility_Toolkit]
[링크 : http://en.wikipedia.org/wiki/OpenGL_User_Interface_Library]
[링크 : http://en.wikipedia.org/wiki/GLX]
[링크 : http://en.wikipedia.org/wiki/GLSL]




별로 상관은 없을지도 모르지만, openSL은 사운드에 특화된, Sound Library이다.
[링크 : http://en.wikipedia.org/wiki/OpenSL_ES]

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

openGL tutorial  (0) 2011.03.12
openGL, GLU, GLUT 관계  (4) 2011.03.07
openGL - GLUT  (0) 2010.08.26
glBegin() / glEnd()  (3) 2010.08.23
openGL 문서들  (0) 2010.08.22
Posted by 구차니
Programming/Java2010. 8. 18. 00:41
단위 테스트 하면 가장 유명한 녀석은 Junit 이다.
[링크 : http://www.junit.org/]

아무튼, 자바는 안쓰니 C에서 사용가능한 단위 테스트를 찾아보니
glib 에서도 지원하기도 하고, 여러가지 녀석이 있다.

[링크 : http://www.opensourcetesting.org/unit_c.php]
[링크 : http://lethean.pe.kr/2010/02/12/using-glib-test-framework/]

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

Java 에서 파일 목록 엳어오기  (0) 2011.10.29
netbeans 에서 코드 자동정렬  (0) 2011.10.29
Java용 폴더 다이얼로그  (0) 2011.10.28
netbeans IDE  (0) 2010.08.23
java에는 unsigned가 없다고?!  (0) 2009.09.03
Posted by 구차니

[링크 : http://book.daum.net/detail/book.do?bookid=KOR9788955024609]

자바스크립트 관련 내용을 보다가, 생각만큼 DOM 관련 내용은 없어서 대충 넘긴책.
하지만 HTML 관련 내용은 상당히 조리있고 깔끔하고 강력하게 적혀있다.


그리고 처음 알게된 attribute로
style="filter:flip()"
이런 녀석이 있다는걸 처음 알았다.
역시 세상에는 신기한게 많아 -ㅁ-


[링크 : http://www.w3schools.com/Css/css_image_transparency.asp]
[링크 : http://msdn.microsoft.com/en-us/library/ms532847%28VS.85%29.aspx]
Posted by 구차니
한참을 고심하다가, 검색어를 바꾸니 떡! 하고 나온녀석 OTL

Getting a text node from the table

This example introduces two new DOM attributes. First it uses the childNodes attribute to get the list of child nodes of mycel. The childNodes list includes all child nodes, regardless of what their name or type is. Like getElementsByTagName(), it returns a list of nodes. The differences are that (a) getElementsByTagName() only returns elements of the specified tag name; and (b) getElementsByTagName() returns descendants at any level, not just immediate children. Once you have the returned list, use [x] method to retrieve the desired child item. This example stores in myceltext the text node of the second cell in the second row of the table. Then, to display the results in this example, it creates a new text node whose content is the data of myceltext and appends it as a child of the <body> element.

If your object is a text node, you can use the data attribute and retrieve the text content of the node.
mybody      = document.getElementsByTagName("body")[0];
mytable = mybody.getElementsByTagName("table")[0];
mytablebody = mytable.getElementsByTagName("tbody")[0];
myrow = mytablebody.getElementsByTagName("tr")[1];
mycel = myrow.getElementsByTagName("td")[1];

// first item element of the childNodes list of mycel
myceltext=mycel.childNodes[0];

// content of currenttext is the data content of myceltext
currenttext=document.createTextNode(myceltext.data);
mybody.appendChild(currenttext);

Getting an attribute value

At the end of sample1 there is a call to setAttribute on the mytable object. This call was used to set the border property of the table. To retrieve the value of the attribute, use the getAttribute method:

mytable.getAttribute("border");

[링크 : https://developer.mozilla.org/en/traversing_an_html_table_with_javascript_and_dom_interfaces]

Posted by 구차니
onload는 페이지가 다 읽혀진뒤에 불리워지는 핸들러이고
onresize는 페이지 크기 조절시
onblur는 특정 컨트롤의 포커스를 잃을시 발동되는(?) 핸들러라고 한다.

onafterprint
onbeforeprint
onbeforeunload
onblur
onerror
onfocus
onhashchange
onhelp
onload
onmessage
onresize
onscroll
onunload

2010/07/20 - [Programming/Javascript] - javascript 객체출력

[링크 : http://koxo.com/lang/js/event/jsList.html]
    [링크 : http://koxo.com/lang/js/event/onblur.html]
Posted by 구차니
자바 스크립트 관련 책을 보다보니
innerHTML은 브라우저 별로 지원은 하지만, 웹 표준은 아니므로 DOM 관련 함수를 쓰라고 추천하고 있다.
하지만 막상 검색을 해보니, 성능측면에서 DOM 보다는 innerHTML을 추천하는 내용들이 많이 나온다.

아무튼,
"대규모로 조작을 해야 한다면 innerHTML에 한번에 업데이트 하는 것도 고려할만 하다.
하지만 내용이 많지 않을경우에는 DOM을 하는것이 좋다."
라는 것이 결론.

[링크 : http://forums.mozilla.or.kr/viewtopic.php?p=32382]
[링크 : http://firejune.com/976&stag=innerHTML]
[링크 : http://trend21c.tistory.com/929]
Posted by 구차니