'프로그래밍'에 해당되는 글 59건
- 2009.05.30 스케일된 오브젝트의 노말 변환 1
- 2009.05.26 난 웨 pix로 다른게임을 돌려볼 생각을 못했지
- 2009.05.13 파일을 저장할때
- 2009.03.01 ik :: ccd 적용 예제(발표자료 포함)
- 2009.01.07 Printf shader for debugging pixel shaders - pix for windows 2
- 2009.01.07 스터디 발표자료 준비
- 2008.11.12 UI를 랜더링 할때
- 2008.10.21 퍼프후드를 적용하려면? in DXUT DX9
- 2008.10.15 HLSL saturate function
- 2008.09.29 [펌] 멀티맵 사용 예제 1
관련 발표자료와 실행가능한 빌드버전입니다.
아래는 그 스샷 입니다.
1. 옆의 깃발4개가 본입니다. 상측본으 용머리가 이팩터라고 생각하시면 됩니다.
2. 이팩터의 바로 아래 본의 타켓 방향으로 회전시킵니다. 하지만 타겟을 범위안쪽으로 도록하지 못했습니다.
2. 다음 본을 회전시켜 타겟과의 거리를 축소시킵니다.
3. 그 다음본을 이동시킵니다.
4. 위와 같은 작업
5. 등록시켜 놓은 본을 모두 작업한뒤에는 다시 이팩터 아래의 본을 회전시킵니다.
6. 위의 작업을 이팩터와 타겟이 만날때까지 작동시킵니다. 프로그램의 최적화를 위해 몇번까지 링크를 검사하려라는 조건을 줄수도 있습니다. 연산도중 타겟과 이팩터가 원하는 범위안에서 만난다면, 작업을 마칩니다. 만나지 않는다면 적당히 돌아간 본을 쓰시는게 좋을듯합니다. (본과 거리가 멀어 애당초 안될수도 있느니, 적당히 쓰는방법이 좋은것 같습니다.)
이렇게 하여 본이 원하는 타겟을 찻아갑니다.
본 예제는 본이 회전될때 한계각을 적용하지 않았습니다. 한번에 회전할수있는 양과, 각 축별 한계가 정해저있다면,
보다 사실적인 ik가 구현될것 같습니다.
Printf shader for debugging pixel shaders - pix for windows

ShaderX5 9-9 Print Shader for Debugging Pixel Shader.pptx
9.9 Printf shader for debugging pixel shaders(예제프로그램)
/*hr = pD3D->CreateDevice( pNewDeviceSettings->d3d9.AdapterOrdinal, pNewDeviceSettings->d3d9.DeviceType,
DXUTGetHWNDFocus(), pNewDeviceSettings->d3d9.BehaviorFlags,
&pNewDeviceSettings->d3d9.pp, &pd3dDevice );*/
UINT AdapterOrdinal = pNewDeviceSettings->d3d9.AdapterOrdinal;
D3DDEVTYPE dtDeviceType = pNewDeviceSettings->d3d9.DeviceType;
for(UINT uiAdaptor = 0 ; uiAdaptor < pD3D->GetAdapterCount() ; ++uiAdaptor)
{
D3DADAPTER_IDENTIFIER9 Identifier;
HRESULT hrRes = pD3D->GetAdapterIdentifier(uiAdaptor,0,&Identifier);
if(strstr(Identifier.Description,"PerfHUD") !=0)
{
AdapterOrdinal = uiAdaptor;
dtDeviceType = D3DDEVTYPE_REF;
break;
}
}
hr = pD3D->CreateDevice( AdapterOrdinal, dtDeviceType,
DXUTGetHWNDFocus(), pNewDeviceSettings->d3d9.BehaviorFlags,
&pNewDeviceSettings->d3d9.pp, &pd3dDevice );
can someone explain what saturate (x) function exactly do?
if x < 0 then result will be 0
if x > 1 then result will be 1
Otherwise, result will be the same as X
아놔 그간 DX 도큐먼트에
Clamps x to the range 0,1
되있어서 와.. 이거 어떤 방식으로 줄이지 라고 졸라 생각했었는데
이런거였어...
//multmap.cpp -- multimap을 사용한다
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
typedef int KeyType;
typedef pair<const KeyType,string> Pair;
typedef multimap<KeyType,string> MapCode;
int main()
{
MapCode codes;
codes.insert(Pair(415,"샌프란시스코"));
codes.insert(Pair(510,"오클랜드"));
codes.insert(Pair(718,"브루클린"));
codes.insert(Pair(718,"스탠튼섬"));
codes.insert(Pair(415,"샌라파엘"));
codes.insert(Pair(510,"버클리"));
cout << "지역코드가 415인 도시 수:" << codes.count(415) << endl;
cout << "지역코드가 510인 도시 수:" << codes.count(510) << endl;
cout << "지역코드가 718인 도시 수:" << codes.count(718) << endl;
cout << "지역 코드 도시\n";
MapCode::iterator it;
for (it = codes.begin(); it != codes.end(); ++ it)
cout << " " << (*it).first << " " << (*it).second << endl;
pair<MapCode::iterator,MapCode::iterator> range = codes.equal_range(718);
cout << "지역 코드가 718인 도시들:\n";
for (it = range.first; it != range.second; ++ it)
cout << (*it).second << endl;
return 0;
}
[출처] multimap사용한 도시명과 코드 예제|작성자 지현사마
쉽게 쓸수 있긴한데 느리진 않겠징...
D3DXMatrixOrthoOffCenterLH( &m_matProj, 0, m_dwWidth, m_dwHeight,0, m_fNearZ, m_fFarZ);
왼쪽 상단이 (0.0) 일반적으로 알고 있는 UV 매핑