회사에서 회식공지. 회식장소가 새마을 식당
흐음.. 만우절이야? 진짜야?

아무튼 시간은 흘러 가려고 나가는데
문짜 띠리링

사장님 장인상
흐음.. 만우절이야? 진짜야?





아침에 출근길에도 어떤 블로거가 돌아가셨다는 글을 보았는데
또 다른 돌아가시는 분이 근처에 있다는 사실에

먼가 정말 오늘하루 만우절 같구나...

[링크 : http://kuaaan.tistory.com/254]
    [링크 : http://uvicrabbit.tistory.com/163]
Posted by 구차니
진심으로 만우절 장난이라고 믿고 싶은 공지네 -_-



아아 술이 싫어 
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2011. 3. 31. 17:58
PINA_Bit0 이런 녀석이 winavr 쪽의 PINA0 이런것과 1:1 매칭이 되는지
PINA0 PORTA0 이런것이 정말 비트 단위로 읽어올수 있고 조작이 가능한지도 모호한 상황인데..
아무튼 아래의 링크는 iar 용 매크로 라던가 변수선언들을 변환하여
일반적인 avr용 컴파일러에서 컴파일이 가능하도록 해주는 래핑소스이다.

#define GPIO_BITREG(port,bitnum) \
        ((volatile BitRegisterType*)_SFR_MEM_ADDR(port) \
        )->bit ## bitnum

#define PINA_Bit0  GPIO_BITREG(PINA,0)
#define PINA_Bit1  GPIO_BITREG(PINA,1)
#define PINA_Bit2  GPIO_BITREG(PINA,2)
#define PINA_Bit3  GPIO_BITREG(PINA,3)
#define PINA_Bit4  GPIO_BITREG(PINA,4)
#define PINA_Bit5  GPIO_BITREG(PINA,5)
#define PINA_Bit6  GPIO_BITREG(PINA,6)
#define PINA_Bit7  GPIO_BITREG(PINA,7)

[링크 : http://www.koders.com/c/fid4B73863201A18CBCB1076C1A7430B0EBF15B6E9F.aspx?s=crc
 


아무튼 자세한건 집에가서 AVR에다가 올려봐야 하려나 -_-
/* Input Pins, Port A */
#define PINA      _SFR_IO8(0x19)
/* Data Direction Register, Port A */
#define DDRA      _SFR_IO8(0x1A)
/* Data Register, Port A */
#define PORTA     _SFR_IO8(0x1B)

/* Port A Data Register - PORTA */
#define    PA7       7
#define    PA6       6
#define    PA5       5
#define    PA4       4
#define    PA3       3
#define    PA2       2
#define    PA1       1
#define    PA0       0

/* Port A Data Direction Register - DDRA */
#define    DDA7         7
#define    DDA6         6
#define    DDA5         5
#define    DDA4         4
#define    DDA3         3
#define    DDA2         2
#define    DDA1         1
#define    DDA0         0

/* Port A Input Pins - PINA */
#define    PINA7        7
#define    PINA6        6
#define    PINA5        5
#define    PINA4        4
#define    PINA3        3
#define    PINA2        2 
#define    PINA1        1
#define    PINA0        0

[출처: C:\WinAVR-20100110\avr\include\avr\iom128.h] 
 
-- 퇴근후 추가
대충해보니 머.. 정의문이라서 정수로 들어가다 보니 아무런 의미도 없는듯 -_-
아무튼, PINA.0 이런식으로 구성이 가능한것은  code vision 쪽 확장인것으로 추측되고
winavr에서는 표준적으로 비트 마스킹을 통해서만 가능한 것으로 추측된다.

[링크 : http://down.file.naver.com/howpc/kin.nhn?m=read&section=read&docid=117760743&page=362]
[링크 : http://cafe359.daum.net/_c21_/bbs_search_read?grpid=1DDsW&fldid=9E8k
Posted by 구차니
찾아봐도 레지스트리도 없고, 폴더도 없고 흐음.. 그래도 찜찜한데..
기사 업데이트 내용으로 사실무근에 백신 프로그램의 오진이라고 하는데
평소에 하는 짓꺼리가 참으로 이쁘다 보니 믿을수가 있어야 말이지 -_-

[링크 : http://www.kbench.com/news/?cc=62&pr=0&no=98717]
[링크 : http://hummingbird.tistory.com/2880]
    [링크 : http://download.cnet.com/8301-2007_4-20048963-12.html]
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2011. 3. 31. 09:37
아래는 winavr의 iom64.h의 내용중 일부이다
/* Input Pins, Port A */
#define PINA      _SFR_IO8(0x19)

/* Data Direction Register, Port A */
#define DDRA      _SFR_IO8(0x1A)

/* Data Register, Port A */
#define PORTA     _SFR_IO8(0x1B)

정리하자면
PINA는 입력된 값을 읽고
PORTA는 출력할 값을 읽고
DDRA는 그 포트의 방향을 정해준다.

예를들어, UART 같은 경우
TX 값은 PORTA에 쓰고, RX값은 PINA에서 읽는 식이라고 하면 되려나?
Pin* is for read, Port* is for write and DDR* is for direction... 
* = Register ( A, D,C...) 

PIN* is the register you use to read the value on a port if it is an input (so if the corresponding bit in DDR* is '0'). PORT* is used to output values, or to read earlier outputted values back.
 
[링크 : http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=197070]
 


Posted by 구차니
Microsoft/Visual Studio2011. 3. 30. 22:55
비쥬얼 스튜디오에서 아무생각없이 프로젝트를 생성하고
openGL 설정을 하고 컴파일을 하는데 아래와 같은 에러가 발생했다.

링크하고 있습니다...
MSVCRTD.lib(crtexew.obj) :
error LNK2019: _WinMain@16 외부 기호(참조 위치: ___tmainCRTStartup 함수)에서 확인하지 못했습니다.
C:\orbit\Debug\orbit.exe : fatal error LNK1120: 1개의 확인할 수 없는 외부 참조입니다.

아무튼 프로젝트를 생성할때 보면
"Win32 프로젝트" 와


"Win32 콘솔 응용 프로그램" 으로 나뉘는데


Win32 프로젝트는 WinMain() 이 entry 포인트이기 때문에 위와 같은 에러가 발생한다.
정말 독립된 프로그램을 작성한다면 "Win32 콘솔 응용 프로그램"을 선택해야 한다.

Posted by 구차니
개소리 왈왈2011. 3. 30. 19:17
기간은 31일까지이니 필요하신분은 고고싱~

[링크 : http://sqlgate.com/kr/support/sqlgate_survey_event.html]

'개소리 왈왈' 카테고리의 다른 글

쉼표  (6) 2011.04.03
500ml 중 1회 분량 200ml  (0) 2011.04.02
오오 폐건전지를 이래서 수거하는 거였군!  (4) 2011.03.27
내 눈깔  (2) 2011.03.21
허스키 익스프레스 서비스 종료  (0) 2011.03.21
Posted by 구차니
Programming/openGL2011. 3. 30. 07:35
머리를 자른건가 -_-!
절두체(frustum)라는 것은 "평행한 두 평면"으로 잘려진 도형을 의미한다.
예를 들어 직사각형처럼 긴 육면체를 두개의 평면으로 적당하게 잘라서 정육면체로 만들수 있고
원추를 잘라 마름모형 6면체로도 만들수 있다.




간단하게 원근감을 나타내기 위한 방법으로서, 투형되는 공간의 부피를 설정하는 함수이다.
void glFrustum(GLdouble left, GLdouble right,
                      GLdouble bottom, GLdouble top,
                      GLdouble nearVal, GLdouble farVal);

glFrustum describes a perspective matrix that produces a perspective projection.

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

그런데... 어떻게 윗면과 아랫면의 크기를 정하지?
무조건 중심점에서 해당 좌표까지의 크기에서 near / far로 자르는걸려나? 
Posted by 구차니
Programming/openGL2011. 3. 29. 23:22
여전히 glPushMatrix / glPopMatrix의 마법은 이해를 하지 못했지만
이녀석이 없으면 이상한 좌표축에서 이상하게 작동하는 것으로 보인다 -_-

아무튼 glPushMatrix 이후에는 추가된 개체를 중심으로
glRotate / glTranslatef 가 수행이 되며 push/pop이라는 용어가 보여주듯
스택에 차곡차곡 쌓이며 추가된 이후의 객체에 대해 적용이 된다.

스택에 들어가는 것과 공간의 변화를 한번 정리해보자면 다음과 같은데

어떻게 보면 Rotate와 Translate는 좌표계 자체를 변경시키며
왜곡된(?) 공간에 개체를 놓으면서 회전을 시키는 식으로 구성이 된 것으로 보인다.

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

static int year = 0, day = 0;

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

	glPushMatrix();
		glutWireSphere(1.0, 20, 16);   /* draw sun */

		glRotatef((GLfloat) year, 0.0, 1.0, 0.0);
		glTranslatef(2.0, 0.0, 0.0);
		glRotatef((GLfloat) day, 0.0, 1.0, 0.0);
		glutWireSphere(0.2, 10, 8);    /* draw smaller planet */
	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)
	{
	  case 'd':
		  day = (day + 10) % 360;
		  glutPostRedisplay();
		  break;
	  case 'D':
		  day = (day - 10) % 360;
		  glutPostRedisplay();
		  break;
	  case 'y':
		  year = (year + 5) % 360;
		  glutPostRedisplay();
		  break;
	  case 'Y':
		  year = (year - 5) % 360;
		  glutPostRedisplay();
		  break;
	  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;
}

void glMatrixMode(GLenum mode);
    GL_MODELVIEW  Applies subsequent matrix operations to the modelview matrix stack.
    GL_PROJECTION Applies subsequent matrix operations to the projection matrix stack.
    GL_TEXTURE    Applies subsequent matrix operations to the texture matrix stack.
    GL_COLOR      Applies subsequent matrix operations to the color matrix stack.

void glShadeModel(GLenum mode);
    GL_FLAT     Smooth shading causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment.
    GL_SMOOTH   Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. 

void glPushMatrix(void);
void glPopMatrix(void);

void glTranslated(GLdouble x, GLdouble y, GLdouble z);
void glTranslatef(GLfloat x,  GLfloat y,  GLfloat z);

void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);

void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
void glRotatef(GLfloat angle,  GLfloat x,  GLfloat y,  GLfloat z);

void gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);

void gluLookAt(GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ,
                        GLdouble centerX, GLdouble centerY, GLdouble centerZ,
                        GLdouble upX, GLdouble upY, GLdouble upZ);

[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glTranslate.xml]             glTranslatef
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glRotate.xml]                 glRotate
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glShadeModel.xml]        glShadeModel
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glPushMatrix.xml]          glPushMatrix / glPopMatrix
[링크 : http://www.opengl.org/sdk/docs/man/xhtml/glMatrixMode.xml]         glMatrixMode

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

[링크 : http://www.opengl.org/documentation/specs/glut/spec3/node81.html] glutWireSphere 

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

glViewport  (0) 2011.04.05
glFrustum - 절두체  (6) 2011.03.30
openGL callback function - GLUT 키보드 / 마우스 입력  (0) 2011.03.28
freeglut  (0) 2011.03.26
openGL - glbegin()  (2) 2011.03.25
Posted by 구차니
옵저버 같은 홈페이지인데
정부에서 공식발표하는 자료를 이용하여 실시간 업뎃을 한다는데
"정부" 제공이라면 충분히 은폐가 된 정보일 가능성이 높으니 믿어도 될랑가 -_-
[링크 : http://www.stubbytour.com/nuc/index.asp]


아무튼 한국전역에서 방사성 요오드가 발견되었다는 뉘우스~
[링크 : http://photo.media.daum.net/.../view.html?photoid=5414&newsid=20110329140628913&p=yonhap]





이러다가 피로는 간때문이야~ 가 아니라
피로는 핵때문이야~ 이렇게 될듯 -_-



어제 자전거 꼴랑 1시간 탔다고 피곤해진게
자전거 때문이 아닌것 같은 기분탓?!?!? 
Posted by 구차니