2012년 2월 19일 일요일

2012년 2월 13일 월요일

2012년 2월 10일 금요일

When glBindTexture doesn't work... (multiple texture image)

glBindTexture 를 했는데, (glGenTextures 로 값도 잘 얻어 왔는데..)
texture가 안 붙으면..  (texture file 이 여러 개인경우..)

glBegin(GL_TRIANGLES (or..) ) 밖에서 되었는지 확인.
상식적으로 생각해보면 texture는 geometry 를 어떻게 할지 시작하기전에 이루어져야함.
glBegin = delimit the vertices of a primitive or a group of like primitives


찾아보니 아래와 같네..
무조건 받아들이는 거보다 왜 저것만 되는지 생각해보면 납득 OK

You can use only a subset of OpenGL functions between glBegin and glEnd. The functions you can use are:
glVertex
glColor
glIndex
glNormal
glTexCoord
glEvalCoord
glEvalPoint
glMaterial
glEdgeFlag

http://www.gamedev.net/topic/83150-glbindtexture-inside-of-glbegin/

operator delete[]

struct myclass {
  myclass() {Dbg("myclass constructed : %x\n", this);}
  ~myclass() {Dbg("myclass destroyed : %x\n", this);}
};


function1()
{
  myclass * pt;

  pt = new myclass[3];
  delete[] pt;

  return 0;
}

modified from http://www.cplusplus.com/reference/std/new/operator%20delete[]/

Debug 결과 (pt = 0x004229f4 일때)
myclass constructed : 4229f4
myclass constructed : 4229f5
myclass constructed : 4229f6

myclass destroyed : 4229f6
myclass destroyed : 4229f5
myclass destroyed : 4229f4

delete operator만 쓰면 당연 에러..





Me Party

I love Amy Adams.
From the Muppets Movie

2012년 2월 3일 금요일

PZT strain


한 번 꾹 눌렀다가 몇 초 있다가 뗀 거. beam 형태로 된 거 사용. 
1kHz sampling 했음


The piezoelectric effect is a reversible process in that materials exhibiting the direct piezoelectric effect (the internal generation of electrical charge resulting from an applied mechanical force) also exhibit the reverse piezoelectric effect (the internal generation of a mechanical strain resulting from an applied electrical field).
...
The nature of the piezoelectric effect is closely related to the occurrence of electric dipole moments in solids.
...

1.818181818181818

숫자놀이
680/374 = 1.818181818181818 = 20/11
두배보다 살짝 작은...

이걸 제곱하면
1.818181818181818 ^2 = 3.305785123966941
이건 한 평의 넓이 -_-
1.818㎡ = 1평

근데 왜 저런 비율이 동영상에 쓰이지?

2012년 2월 2일 목요일