'Programming'에 해당되는 글 1721건

  1. 2011.09.25 openGL로 싸인곡선 그리기(sin wave) 5
  2. 2011.09.24 webGL
  3. 2011.09.19 OpenMP 그리고 OpenMPI 2
  4. 2011.09.13 python 3.2.2 64bit 버전 설치 4
  5. 2011.09.02 depth buffer
  6. 2011.07.31 .DATA? 지시어
  7. 2011.07.25 Visual Basic에는 % 연산자가 없군 -_-
  8. 2011.07.18 컨트롤 배열을 작성하시겠습니까?
  9. 2011.07.17 x86 register 2
  10. 2011.07.17 openCV OCR 예제
Programming/openGL2011. 9. 25. 22:02
오랫만에 하려니 sin() 함수가 radian 값을 받는것도 깜박잊고 꽤나 헤매게 만드네..

   
#include "GL/gl.h"
#include "GL/glu.h"
#include "GL/glut.h"
#include "math.h"

static int year = 0, day = 0;

void display(void)
{
        int temp;
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(1.0, 1.0, 1.0);

        glPushMatrix();
                glBegin(GL_POINT);
                for(temp = 0; temp < 360; temp++)
                {   
                        glVertex3f(0.01*temp - 2,sin(3.1415927/180*temp),0);
                }   
                glEnd();
        glPopMatrix();

        glutSwapBuffers();
}

void reshape(int w, int h)
{
        glViewport(0, 0, (GLsizei) w, (GLsizei) h); 
        glMatrixMode(GL_PROJECTION);
                glLoadIdentity();
                gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0);
    
        glMatrixMode(GL_MODELVIEW); //GL_PROJECTION
                glLoadIdentity();
                gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}

void keyboard(unsigned char key, int x, int y)
{
        switch (key)
        {   
          default:
                  break;
        }   
}

int main(int argc, char** argv)
{
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
        glutInitWindowSize(500, 500);
        glutInitWindowPosition(100, 100);
        glutCreateWindow(argv[0]);

        glClearColor(0.0, 0.0, 0.0, 0.0);
        glShadeModel(GL_FLAT); //GL_SMOOTH

        glutDisplayFunc(display);
        glutReshapeFunc(reshape);
        glutKeyboardFunc(keyboard);
        glutMainLoop();
        return 0;
}

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

glGet() 함수 이용하기  (0) 2011.09.28
GLUT keyboard callback function  (0) 2011.09.27
webGL  (0) 2011.09.24
depth buffer  (0) 2011.09.02
glGenLists  (0) 2011.06.09
Posted by 구차니
Programming/openGL2011. 9. 24. 15:53
openGL ES2.0 기반의 웹용 GL 이다.

[링크 : http://www.khronos.org/webgl/]
[링크 : http://www.khronos.org/webgl/wiki/Main_Page] << 여기에 데모용 있음
[링크 : http://ko.wikipedia.org/wiki/WebGL

---
Intel GMA915를 내장하는 XNOTE LW20 express + 크롬 에서 실행하니 어라 안되네?

지원되는 운영체제

Windows Vista 및 Windows 7(권장)
Mac OS 10.5 및 Mac OS 10.6(권장)
Linux

 
그래픽 카드

다음 그래픽 카드가 있는 경우에는 WebGL이 지원되지 않으며 기본적으로 사용중지됩니다.

모든 운영체제
    NVIDIA GeForce FX Go5200
Windows
    Intel GMA 945
Mac
    ATI Radeon HD2400
    ATI Radeon 2600 시리즈
    ATI Radeon X1900
    GeForce 7300 GT
Linux
    AMD/ATI
    Intel: 7.9 이전의 Mesa 드라이버
 
[링크 :http://www.google.com/support/chrome/bin/answer.py?answer=1220892
 

glxinfo를 쳐보니
OpenGL renderer string: Mesa DRI Intel(R) 915GM GEM 20091221 2009Q4 x86/MMX/SSE2
OpenGL version string: 1.4 Mesa 7.7.1
음.. 메사가 7.7.1 버전이라 그런가..


----
2011.09.26 추가
AMD 4200+x2 / WinXP SP3 / Nvidia Geforce8800GT 512MB / 266.58  / 크롬


아래 샘플을 돌리니 대략 60% CPU 점유율을 차지하고,
다른탭을 누르면 cpu사용률이 0%로 되는것을 봐서는 활성화 되었을때만 렌더링을 하는 것으로 보인다.



[링크 : http://www.khronos.org/webgl/wiki/Demo_Repository]
    [링크 : https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/webkit/Earth.html

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

GLUT keyboard callback function  (0) 2011.09.27
openGL로 싸인곡선 그리기(sin wave)  (5) 2011.09.25
depth buffer  (0) 2011.09.02
glGenLists  (0) 2011.06.09
glutIdleFunc  (0) 2011.05.13
Posted by 구차니
Programming/openMPI2011. 9. 19. 07:39
libgomp 와 openmpi-dev를 설치하라는데
[http://ubuntuforums.org/showthread.php?t=710281]

서버에서 한번 검색을 해보니
흐으음.. GCC OpenMP의 약자로 GOMP와 openMPI 두가지가 나오고
$ apt-cache search openmp
libgomp1 - GCC OpenMP (GOMP) support library
libgomp1-dbg - GCC OpenMP (GOMP) support library (debug symbols)
lib64gomp1 - GCC OpenMP (GOMP) 지원 라이브러리 (64비트)
lib64gomp1-dbg - GCC OpenMP (GOMP) 지원 라이브러리 (64비트 디버깅 심볼)
conky-all - highly configurable system monitor (all features enabled)
gromacs-lam - Transition package to gromacs-openmpi
gromacs-openmpi - Molecular dynamics sim, binaries for OpenMPI parallelization
libcomplearn-gomp-dev - CompLearn library, OpenMP version development files
libcomplearn-gomp1 - machine-learning core library runtime files with OpenMP (libgomp)
libopenmpi-dbg - high performance message passing library -- debug library
libopenmpi-dev - high performance message passing library -- header files
libopenmpi1.3 - high performance message passing library -- shared library
libqsearch-gomp-dev - CompLearn library, OpenMP version development files
libqsearch-gomp1 - machine-learning core library runtime files with OpenMP (libgomp)
mpi-default-bin - Standard MPI runtime programs
mpi-default-dev - Standard MPI development files
openmpi-bin - high performance message passing library -- binaries
openmpi-checkpoint - high performance message passing library -- checkpoint support
openmpi-common - high performance message passing library -- common files
openmpi-doc - high performance message passing library -- man pages
libhdf5-openmpi-1.8.4 - Hierarchical Data Format 5 (HDF5) - runtime files - OpenMPI version
libhdf5-openmpi-dev - Hierarchical Data Format 5 (HDF5) - development files - OpenMPI version 
 
OpenMP와 OpenMPI는 다르다는데 흐음.. 내가 보기에는 그게 그거지만..
[http://www.linuxquestions.org/questions/programming-9/lost-on-parallel-programming-openmpi-openmp-657210/]

아무튼 MPI는 복잡한 Implementation이라고 하니, OpenMP 부터 해보면 되려나?
[링크 : http://openmp.org/wp/]
[링크 : http://www.open-mpi.org/]
 

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

openMPI 서비스 설치하기...?  (0) 2019.04.02
ubuntu mpich cluster  (0) 2017.02.05
opempi 패키지  (0) 2017.02.04
openmpi with heterogenerous  (0) 2017.02.03
openmpi with openmp  (0) 2017.02.03
Posted by 구차니
이유는 모르겠지만 Windows7 Ultimate 64bit 버전에서 윈도우즈 업데이트를 진행하며 실행하니 오류가 발생했다.
리부팅하고 나니 문제없이 넘어가서 대략 황당 -ㅁ-


 

 

'Programming > python(파이썬)' 카테고리의 다른 글

python2 vs python3  (0) 2013.01.02
PyOpenGL  (0) 2011.10.04
python 버전 골라서 실행하기  (0) 2011.05.08
python C/api - PyObject_GetAttrString()  (0) 2010.04.06
파이썬 문자열 쌍따옴표 세개 - """ python string  (0) 2010.04.04
Posted by 구차니
Programming/openGL2011. 9. 2. 07:53
glVertex() 함수들을 보는데 x,y,z,w 라는 변수들이 있길래
w는 어떤값인지 찾아보니 depth buffer를 위한 값이라고 한다.
일반적으로 깊이값은 Z로 하지 않나? 싶긴한데 흐음..
clipping과 관련된것 같기도 하고.. 모호하네..

[링크 : http://msdn.microsoft.com/en-us/library/dd374160(v=vs.85).aspx]
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml]
[링크 : http://msdn.microsoft.com/en-us/library/bb976071.aspx]

[링크 : http://en.wikipedia.org/wiki/Z-buffering]
[링크 : http://www.opengl.org/resources/faq/technical/depthbuffer.htm]

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

openGL로 싸인곡선 그리기(sin wave)  (5) 2011.09.25
webGL  (0) 2011.09.24
glGenLists  (0) 2011.06.09
glutIdleFunc  (0) 2011.05.13
openGL 좌표계  (0) 2011.05.06
Posted by 구차니
.DATA? 지시어를 사용하여 변수를 선언하면
컴파일된 프로그램의 크기를 줄일수 있다고 한다.
C 언어라던가 일반적인 초기화 되지 않은 변수들을 선언했다고 해서
프로그램 용량이 늘어나는건 아니니 차이를 못느낄수도 있겠지만

x86 계열에서
.data?
bigArray DWORD 5000 DUP(?)
 
는 프로그램의 크기가 늘어나지 않지만

.data
bigArray DWORD 5000 DUP(?)
 
는 프로그램의 크기가 20000 byte 만큼 늘어난다고 한다.

Assembly language for intel-based computer 4th ed. 87page
KIP R. IRVINE 

'Programming > Assembly(어셈블리)' 카테고리의 다른 글

어셈블리 관련  (0) 2015.06.11
ia32 어셈블리 언어  (0) 2013.12.12
x86 register  (2) 2011.07.17
PowerPC(PPC) 어셈관련 내용  (0) 2011.04.04
어셈블리 메모리 참조 (x86 memory addressing)  (0) 2010.05.03
Posted by 구차니
대신 Mod 라는 명령어로 나머지 연산을 해주면 된다.

[링크 : http://msdn.microsoft.com/en-us/library/se0w9esz(v=vs.80).aspx]
Posted by 구차니
VB form을 만들다 보면
Ctrl-c , v 신공에서 항상 이런 메시지를 보게 된다.

 
[링크 : http://ask.nate.com/qna/view.html?n=10574374]

찾아봤더니, 컨트롤 역시 배열로 구성이 가능하며
""를 선택하여 컨트롤 배열로 작성시 Text18(1) 이런식으로 생성이 된다. 

만약 Text20 이런식으로 독립되게 만들고 싶다면
"아니오"를 선택하면 된다. 
Posted by 구차니
각종 레지스터들의 약자에 대한 이름 풀이이다.
아무튼.. SI는 Stack Index가 아닌 Source Index -_-
S는 은근 헷갈린단 말이야.. OTL

Purpose

Although the main registers (with the exception of the instruction pointer) are "general-purpose" and can be used for anything, it was envisioned that they be used for the following purposes:

  • AX/EAX/RAX: accumulator
  • BX/EBX/RBX: base index (ex: arrays)
  • CX/ECX/RCX: counter
  • DX/EDX/RDX: data/general
  • SI/ESI/RSI: "source index" for string operations.
  • DI/EDI/RDI: "destination index" for string operations.
  • SP/ESP/RSP: stack pointer for top address of the stack.
  • BP/EBP/RBP: stack base pointer for holding the address of the current stack frame.
  • IP/EIP/RIP: instruction pointer. Holds the program counter, the current instruction address.
     
[링크 : http://en.wikipedia.org/wiki/X86_architecture#Purpose]

'Programming > Assembly(어셈블리)' 카테고리의 다른 글

ia32 어셈블리 언어  (0) 2013.12.12
.DATA? 지시어  (0) 2011.07.31
PowerPC(PPC) 어셈관련 내용  (0) 2011.04.04
어셈블리 메모리 참조 (x86 memory addressing)  (0) 2010.05.03
어셈블리 언어  (0) 2010.05.03
Posted by 구차니
Programming/openCV2011. 7. 17. 19:05
안드로이드에 openCV 올려서 하는거라던가 좀 쩌는듯 -_-
난 언제쯤 이런거 해볼 정도로 실력이 늘려나 ㅠ.ㅠ

[링크 : http://blog.naver.com/kiml86/40122075613]
[링크 : http://blog.damiles.com/?p=93
[링크 : http://www.youtube.com/watch?v=BLG28-xNoMU
Posted by 구차니