2012년 5월 5일 토요일

Multiple Inheritance

 ... cannot access public member declared in class ...

뭔 소리야.. private도 아니고..
결국은 Multiple Inheritance 에서 public keyword를 안붙여 일어난 일 -_-

class CGLWnd : public CWnd, ddUDP
class CGLWnd : public CWnd, public ddUDP

2012년 5월 2일 수요일

Picking & Dragging

유용하게 자주 쓰는 코드 한 줄

void DWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
PostMessage( WM_NCLBUTTONDOWN, HTCAPTION,
MAKELPARAM( point.x, point.y));
CWnd::OnLButtonDown(nFlags, point);
}

2012년 4월 22일 일요일

배



관점에 따라서는 교체한 Cable TV 단자도
멋진 배가 될 수 있다. 

- 누리의 관점


2012년 4월 21일 토요일

Skipping items in a legend

Each curve has a handle, which can be obtained from the properties.



h1 = plot(rand(1,10));      % Blue line
hold on;
h2 = plot(rand(1,10),'r');  % Red line
h3 = plot(rand(1,10),'g');  % Green line
legend([h1 h3],{'hello','world'});  % Only the blue and green lines appear
                                    %   in the legend


http://www.mathworks.com/matlabcentral/answers/406-how-do-i-skip-items-in-a-legend

2012년 3월 16일 금요일

Gaussian profile of Illustrator format


Illustrator source : Download
profile calculated from Matlab

첫 아침

한국에서의 1년만의 첫 아침. 
날씨만큼 좋은 기분.

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일 목요일