최초작성 : 2005-09-08 15:03

- 추가된 내용 ( 2006.02.23 )
max7은 맥스 자체내의 버그로 Edit Normals Modifier의 노멀값을 제대로 못뽑아온다.
그래서 이 방법은 max7에서는 사용못하고 max7이하에서는 face를 덧대서 만들어서 hide시키는 방식으로 해야한다.
max8에서는 정상적으로 나오는걸 확인함

ps. 귀찮아하시는 분들을 위해 원본, 쪼갠후, Modify넣은후의 맥스파일을 첨부한다


캐릭터에 분절을 넣어서 부위별 아이템 교체를 하기 위해서 팔다리를 자르다 보면 위와 같이 별도의 오브젝트여서 노멀이 연속되지 않는 경우가 발생한다.

노멀 수정을 해줄 오브젝트를 선택하고 Edit Normals Modifier를 넣어준다.
위 그림에서는 둘 다 같이 잡았음

그럼 이렇게 각 버택스의 노멀값이 라인으로 표시되는데 수정을 해줄 노멀들을 드래그 해서 선택해준다.

그리고 Average의 Use Threshold를 체크 해주고(체크하지 않으면 선택된 노멀의 전체 평균이 나와버린다)
Select를 눌러주면 위와 같이 같은 위치의 노멀들이 평균되게 수정되어 연속된 노멀을 구할 수 있다.

---------------------------------------------------

이걸 몰라서 한참 삽질했다-_-

엔진담당 프로그래머임에도 맥스를 잘 쓰지 못해 오브젝트 모양이 엉망인거는 양해해 주기 바란다-_-;;;
그나마 위에꺼처럼 오브젝트 찌그러트려서 두 개로 나누는것도 모델러 어깨너머로 컨닝했다-_-;



'자료 > 내자료' 카테고리의 다른 글

MSB/LSB template  (0) 2006.05.18
is_template  (0) 2006.05.10
enum string  (0) 2005.07.08
텍스쳐 포맷 변경해서 저장하기  (0) 2005.05.16
Alkanoid프로젝트 완료  (0) 2004.12.23
abs(a)
Absolute value (per component).
reflect(i, n)
Returns the reflection vector v, given the entering ray direction i, and the surface normal n. Such that v = i - 2 * dot(i, n) * n
sin(x)
cos(x)
tan(x)
Returns the sine/cosine/tangent of x.
refract(i, n, eta)
Returns the refraction vector v, given the entering ray direction i, the surface normal n, and the relative index of refraction eta. If the angle between i and n is too great given eta, refract returns (0,0,0).
cross(a, b)
Returns the cross product of two 3-D vectors.
round(x)
Rounds x to the nearest integer.
distance(a, b)
Returns the distance between two points, a and b.
rsqrt(a)
Inverse square root: 1 / Square root (per component).
dot(a, b)
Returns the dot product of two vectors a and b.
saturate(x)
Clamps x to the range [0, 1].
frac(x)
Returns the fractional part f of x, such that f is a value greater than or equal to 0, and less than 1.
sqrt(a)
Square root (per component).
lerp(a, b, s)
Returns a + s(b - a). This linearly interpolates between a and b, such that the return value is a when s is 0, and b when s is 1.
tex1D(s, t)
1-D texture lookup. s is a sampler or a sampler1D object.  t is a scalar.
max(a,b)
min(a, b)
Selects the greater/lesser of a and b.
tex2D(s, t)
2-D texture lookup. s is a sampler or a sampler2D object.  t is a 2-D texture coordinate.
mul(a, b)
Performs matrix multiplication between a and b. If a is a vector, it’s treated as row vector. If b is a vector, it is treated as column vector.
tex3D(s, t)
3-D volume texture lookup. s is a sampler or a sampler3D object.  t is a 3-D texture coordinate.
normalize(x)
Returns the normalized vector x / length(x). If the length of x is 0, the result is indefinite.
texCUBE(s, t)
3-D cube texture lookup. s is a sampler or a samplerCUBE object.  t is a 3-D texture coordinate.
pow(x, y)
Returns xy

'자료 > Article' 카테고리의 다른 글

Logarithmic Shadow Maps  (0) 2006.10.27
Inverse Kinematics 자료 (IK)  (0) 2005.12.22
How To: Use CLR Profiler  (0) 2005.07.06
c++ stl에서 에서 유니코드 스트링 사용하기  (0) 2005.06.21
stl을 dll로 만들때 문제점  (0) 2005.06.08


2005.06.06 : 생성
2005.06.07 : lib에서 사용할 때의 버그 수정
2005.07.07 : 직접 스트링을 지정할 수 있도록 추가
2005.07.08 : type명 제외하고 사용하도록 수정
2005.07.08 : 버그 수정및 검증 루틴 추가

enum을 스트링으로 바꾸거나 스트링을 enum으로 바꾸는 문제에 대해서 계속 고민해왔는데.
결론은 내부에 map이 필요하다..였다.

map에 enum과 스트링을 연결시켜주는건 직접 해주는 방식으로 사용했었는데..
흐음..어쨋건 정리된 소스를 받아보시라

사용방법은 두가지 인데.

1번째 방법은 매크로 함수의 특성상 127개의 인자밖에 못받는다.
100개까지 받도록 정의해 놓았다.
2번째 방법의 개수의 제한이 없지만 1번째 방법이 기존의 enum에서 약간만 바꾸면 되는 반면
2번째 방법은 좀 더-_- 바꿔야 한다.

아래와 같이 사용할 수 있다.

// solution 1 limit size 100
SENUM_3( MODE, 1, 2, 3 );
// solution 2 no limit
#define ENUM_BODY_MODE( value ) ENUM_BODY( MODE, value )
#define SENUM_ADD_MODE( value ) SENUM_ADD( MODE, value )

#define MODE_ENUM_LIST( _ ) \
_( 1 )  \
_( 2 )  \
_( 3 )
DEFINE_ENUM( MODE, MODE_ENUM_LIST );

// use
auto define MODE_MAX : 3 not match string
const tstring& str1 = MODE_CONVERTER( MODE_1 );  // return "1"
MODE m = MODE_CONVERTER( _T( "1" ) );   // return MODE_1 : 0

// solition 3 is same soulution 2 but can use special string

#define ENUM_BODY_MODE( value, str ) ENUM_BODY_PAIR( MODE, value, str )
#define SENUM_ADD_MODE( value, str ) SENUM_ADD_PAIR( MODE, value, str )

#define MODE_ENUM_LIST( _ ) \
_( A, a )  \
_( B, b )  \
_( C, c )
DEFINE_ENUM( MODE, MODE_ENUM_LIST );

// use
auto define MODE_MAX : 3 not match string
const tstring& str1 = MODE_CONVERTER( MODE_A );  // return "a"
MODE m = MODE_CONVERTER( _T( "a" ) );   // return MODE_A : 0

ps. 자료를 함께 찾아주신 박대중 과장님께 감사의 말씀을 :)

'자료 > 내자료' 카테고리의 다른 글

is_template  (0) 2006.05.10
분절 모델의 접합부위 Normal값 수정  (0) 2006.02.23
텍스쳐 포맷 변경해서 저장하기  (0) 2005.05.16
Alkanoid프로젝트 완료  (0) 2004.12.23
DX에서 쓰는 텍스쳐 썸네일 만들기  (0) 2004.10.02

원본글 : http://www.gosu.net/GosuWeb/Article-detail.aspx?ArticleCode=345

int main(int argc, char* argv[])

{

 std::locale::global( std::locale( "kor" ) );

 std::wstring wideString=L"테스트 문자열 - 유니코드";

 std::wcout<<wideString<<std::endl;

 return 0;

}

위와 같이 처리하면 화면에 "테스트 문자열 - 유니코드" 라고 찍히는 것을 볼 수 있습니다.핵심은 볼드체 처리한 부분의 코드입니다.

std::wcin.imbue( std::locale( "korean" ) );

std::wcout.imbue( std::locale( "korean" ) );

다음과 같이 지정하면 현재 쓰고 있는 wcin과 wcout 에만 영향을 미치게 됩니다. 따라서 위와 같이 골치 아픈 문제는 일단 피할 수 있겠죠?

그리고 이에 대한 자료가 더 필요하시면 http://www.cantrip.org/locale.html 여기 가서 더 읽어보시거나 Standard C++ IOStreams and Locales: Advanced Programmer's Guide and Reference 또는 C++ Standard Library 라는 책을 참고하시길 바랍니다.

--------------------------------------------

오늘의 교훈

책을 사면 좀 읽쟈

탐색기에서 오른쪽 마우스 버튼 클릭시 도스 프롬프트 뜨게 만들기

1. 레지스트리 편집기를 실행합니다.(시작 > 실행 > regedit)
2. HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory 로 이동하여 Shell에서 마우스 오른쪽버튼 클릭하여 [새로 만들기 - 키]를 클릭. 키 이름에 'Dos Prompt'를 입력합니다.


3. 'Dos Prompt'키를 클릭하여, 오른쪽에서 (기본값)을 더블 클릭하여, "문자열 편집" 대화상자에서 '값 데이터'란에 오른쪽 버튼을 클릭하였을 때 나타날 문구를 입력합니다.

4. Dos Prompt 키에서 다시 오른쪽 버튼을 클릭하여, [새로 만들기 - 키]를 통해 Command라는 키를 생성합니다. 생성된 Comand 키를 클릭하여, 오른쪽 (기본값)을 더블클릭합니다. "문자열 편집"대화상자에서 '값 데이터'란에 "cmd.exe /k"를 입력합니다.

5. 이제 탐색기에서 원하는 폴더에서 오른쪽 버튼을 클릭하면, 위에서 3번에 입력한(본 예에서는 '도스프롬프트') 문구가 나오고, 이를 클릭하면 해당 디렉토리를 경로로 하는 도스 프롬프트가 실행된다.

LPD3DXBUFFER pBuffer = NULL;

if( D3DXSaveTextureToFileInMemory( &pBuffer, D3DXIFF_TGA, pTexture, NULL ) == D3D_OK )
{
SAFE_RELEASE( pTexture );

D3DXCreateTextureFromFileInMemoryEx( pd3dDevice, pBuffer->GetBufferPointer(), pBuffer->GetBufferSize(), D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_DXT5, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, 0, &pTexture );
ASSERT( m_pLightMap != NULL );

SAFE_RELEASE( pBuffer );

D3DXSaveTextureToFile( pFilename, D3DXIFF_DDS, pTexture, NULL );
}


용문씨 가져가~

'자료 > 내자료' 카테고리의 다른 글

분절 모델의 접합부위 Normal값 수정  (0) 2006.02.23
enum string  (0) 2005.07.08
Alkanoid프로젝트 완료  (0) 2004.12.23
DX에서 쓰는 텍스쳐 썸네일 만들기  (0) 2004.10.02
크래시 리포트를 만들어 보쟈  (0) 2004.09.02

+ Recent posts