안녕하세요.. 첫글입니다..^^
학규님도 이 책 보시는것 같아 질문드립니다..
29장, 30장에 있는 코드중에, 월드좌표를 광원이나 그림자의 텍스쳐 좌표로 맵핑해주는 코드에서,
D3DXMATRIX TextureMatrix;
//NOTE: This is a bit of a hack. The 128 value is hardcoded because that is the
//width of the texture. If you change the texture, change the value
float Offset = 0.5f + (0.5f / 128.0f);
---------------요고!!!!!!!!!!!
ZeroMemory(&TextureMatrix, sizeof(D3DXMATRIX));
TextureMatrix._11 = 0.5f;
TextureMatrix._22 = -0.5f;
TextureMatrix._33 = 1.0f;
TextureMatrix._41 = Offset;
TextureMatrix._42 = Offset;
TextureMatrix._44 = 1.0f;
D3DXMATRIX LightMatrix = LightView * LightProjection * TextureMatrix;
여기서, float Offset = 0.5f + (0.5f / 128.0f);이부분, +(0.5f/128.0f)가 뭐하는건지 잘 모르겠습니다.
프로젝션 좌표(-1~1)에서 텍스쳐 좌표(0~1)로 해줄려면 걍 x' = x*0.5+0.5만 하면 될거같은데,, 저건 왜 더하는겁니까?
그리고,, 31장 범프맵핑, 모델공간->텍스쳐 공간 바꿔주는 매트릭스 생성 부분 죽어도 모르겠습니다-_-;
설명좀 부탁드립니다... (_ _)
target=_blank>http://www.gamza.net/ez2000/ezboard.exe?db=Programming&action=read&dbf=10&page=0&depth=1
범프매핑에 대한 부분은 저도 책에 있는 것보다 더 자세히 설명할 자신이 없네요. 구체적으로 어떤 부분이 이해가 안가는지 지적해주시면 보충설명을 드리겠습니다.