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

2012년 1월 31일 화요일

복사꽃 무더기로 피더이다




멀고 먼 인생길, 어찌 평탄한 길만 있겠습니까. 때로는 오르막, 또 때로는 내리막. 더러는 주막집 문전걸식에 더러는 잔칫집 진수성찬. 눈보라 몰아치는 엄동설한 지겹도록 길더니, 걷다 보니 어느새 화창한 봄. 걸음마다 복사꽃도 무더기로 피더이다.


아...멋지다.

2012년 1월 29일 일요일

Galactic coordinate system


Galactic coordinate system

멋지다.

The galactic coordinate system (GCS) is a celestial coordinate system which is centered on the Sun and is aligned with the apparent center of the Milky Way galaxy. The "equator" is aligned to the galactic plane. Similar to geographic coordinates, positions in the galactic coordinate system have latitudes and longitudes. The northern galactic pole is located in the constellation of Coma Berenices while the southern pole lies in Sculptor.

http://en.wikipedia.org/wiki/Galactic_coordinate_system


2012년 1월 27일 금요일

Manipulatory and ambulatory space



Lederman, Klatzkey, Collins, Wardell (1987)  made a distinction between manipulatory and ambulatory space, the former within reach of the hands and the latter requiring exploration by movements of the body.

Lederman, S. J., Klatzky, R. L., Collins, A. and Wardell, J. Exploring environments by hand or foot: Time-based heuristics for encoding distance in movement space. Journal of Experimental Psychology: Learning, Memory, and Cognition, 13, 4 (1987), 606-614.

2012년 1월 13일 금요일

Perspective correct barycentric coordinate

Perspective effect가 있으면, projected space에서 barycentric 계산 틀려짐.
아래는 nvidia 어디에선가 가져온 자료.

그냥 Object space에서 해결.




시간나면 다른 방법으로도 풀어봐야겠다.

cursor위치에서 vertex normal을 이용하여 normal vector interpolation을 하기 위함

Perspective-correct barycentric coordinate for picking:


     float b0 = _area[0];
     float b1 = _area[1];
     float b2 = _area[2];

     float w0 = p_rot_face[0].z;
     float w1 = p_rot_face[1].z;
     float w2 = p_rot_face[2].z;

     w_= b0/w0 + b1/w1 + b2/w2;

     w_ = 1.0/w_;

     _area[0] = _area[0] / w0 * w_;
     _area[1] = _area[1] / w1 * w_;
     _area[2] = _area[2] / w2 * w_;





2012년 1월 7일 토요일

iMame

파일 리스트


daleks-iPhone:/User/Applications/...F4B24/Documents root# ls -alt
ls: unrecognized prefix: mh
ls: unparsable value for LS_COLORS environment variable
total 1660
drwxr-xr-x 2 mobile mobile     170 Dec 23 13:56 iOS/
drwxr-xr-x 2 mobile mobile     102 Dec 23 13:53 folders/
drwxr-xr-x 8 mobile mobile     748 Dec 23 13:52 ./
drwxr-xr-x 2 mobile mobile     408 Dec 22 01:48 __MACOSX/
drwxr-xr-x 2 mobile mobile      68 Dec 22 01:48 cfg/
drwxr-xr-x 2 mobile mobile      68 Dec 22 01:48 hi/
drwxr-xr-x 2 mobile mobile      68 Dec 22 01:48 nvram/
drwxr-xr-x 6 mobile mobile     272 Dec 22 01:47 ../
-rw-r--r-- 1 mobile mobile    6114 Dec  1 23:46 crash.zip
-rw-r--r-- 1 mobile mobile   23591 Dec  1 23:46 fireone.zip
-rw-r--r-- 1 mobile mobile   20198 Dec  1 23:46 hardhat.zip
-rw-r--r-- 1 mobile mobile   28721 Dec  1 23:46 robby.zip
-rw-r--r-- 1 mobile mobile    6046 Dec  1 23:46 robotbwl.zip
-rw-r--r-- 1 mobile mobile    5621 Dec  1 23:46 sidetrac.zip
-rw-r--r-- 1 mobile mobile    9791 Dec  1 23:46 spectar.zip
-rw-r--r-- 1 mobile mobile   17034 Dec  1 23:46 starfire.zip
-rw-r--r-- 1 mobile mobile    8089 Dec  1 23:46 targ.zip
-rw-r--r-- 1 mobile mobile    6288 Dec  1 23:46 circus.zip
-rw-r--r-- 1 root   mobile  267019 Apr 10  2003 gladiatr.zip
-rw-r--r-- 1 root   mobile 1170578 Apr 10  2003 goldnaxe.zip
-rw-r--r-- 1 root   mobile   36610 Apr  8  2003 goonies.zip
-rw-r--r-- 1 root   mobile   66256 Apr  8  2003 gberet.zip

2011년 12월 31일 토요일

생각의 시간

까페에 앉아 생각하는 여유있는 시간


- Posted using BlogPress from my iPhone