본문 바로가기
백준 2579 C++ 이차원 배열로 이전 걸 밟았는지 아닌지 판단하여 넣을 수 있다면 쉽게 풀 수 있는 문제였다.연습용이라서 bottom up이랑 top down 둘 다 해봤다.#include using namespace std;//연속된 세 개의 계단을 밟아선 안된다.//계단은 한개 또는 두개씩 오를 수 있다.int n;int stairs[310];int dp[310][2]; //stairs 최대값, 0 = 이전걸 밟지 않음. 1 = 이전걸 밟았다.int go(int num, int before){ int& ret = dp[num][before]; //num이라는 stairs에서 이전의 밟았는지 아닌지 if (ret != 0) return ret; //이미 값이 존재한다면 그냥 return; if (before == .. 2025. 3. 5.
백준 2748 C++ 호기롭게 DP를 외판원 순회로 풀어보고 벽을 느끼고다른 문제로 다시 갔을 때 기초가 없는 것 같아서 아예 브론즈 문제부터 풀려고 한다. 가장 기초인 피보나치 수열 문제이다.#include using namespace std;int n;long long dp[100];int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; dp[0] = 0; dp[1] = 1; dp[2] = 1; for (int i = 3; i  #include using namespace std;int n;long long dp[100];long long fibo(int num){ if (num == 1 || num == 2) { return 1; } i.. 2025. 3. 4.
Unreal Skeletal Mesh to Procedural Mesh - Slice 이제 잘라보자.자르는 코드는 어렵지 않다.void AEnemy::SliceMeshAtBone(FVector SliceNormal, bool bCreateOtherHalf) { if (!GetMesh()|| !ProcMeshComponent) { UE_LOG(LogTemp, Warning, TEXT("SliceMeshAtBone: SkeletalMeshComponent or ProcMeshComponent is null.")); return; } FVector BoneLocation = GetMesh()->GetBoneLocation(TargetBoneName); if (BoneLocation == FVector::ZeroVector) { UE_L.. 2025. 2. 26.
Unreal Skeletal Mesh to Procedural Mesh - 멀티 스레드 사용 지금까지 한 방법은 모든 SkeletalMesh의 모든 vertex를 순회한다는 것이다.for문만 23309번 도는 것을 확인할 수 있다. 지금 3D Model이 1개만 있어서 성능적으로 그게 문제가 없다고 느껴지지만 이후에 더 늘어나면 더 성능에 부담이 될 것이라고 생각이 된다.그렇기에 BeginPlay에서 미리 Game Thread가 아닌 다른 Thread에서 vertex만 선별해보기로 했다. 방법은 간단하다.void AEnemy::SelectVertices(int32 LODIndex){ if (!GetMesh() || !ProcMeshComponent){ UE_LOG(LogTemp, Warning, TEXT("CopySkeletalMeshToProcedural: SkeletalMeshC.. 2025. 2. 25.
Unreal Skeletal Mesh to Procedural Mesh - 일정 범위 복사 이번엔 저번에 이어서 일부분만 Procedural Mesh로 제작한 방법을 알아보자. 전체 코드는 다음과 같다. 이전 버전에서 수정한 것이라 동일한 부분이 많아서 동일한 부분 설명은 생략한다.void AEnemy::CopySkeletalMeshToProcedural(int32 LODIndex){ if (!GetMesh() || !ProcMeshComponent) { UE_LOG(LogTemp, Warning, TEXT("CopySkeletalMeshToProcedural: SkeletalMeshComponent or ProcMeshComp is null.")); return; } //Skeletal Mesh의 Location과 Rotation을 들고온다. .. 2025. 2. 25.
Unreal Skeletal Mesh to Procedural Mesh - 전체 Skeletal Mesh 복사 2024 Unreal Fest를 보고 절단을 구현하고 싶었다. (구현 버전은 Unreal 5.4이다)https://www.youtube.com/watch?v=IL9j4NchTvA&list=PLBHH5tjTRZxLVLsfs4NCeImcX5XSYhH-G&index=22Unreal Fest의 동영상은 위와 같다. 절단부분은 25:30부터 참고하면 된다. Skeletal Mesh에서의 절단의 프로세스는 정말 간결하게 설명하면 Skeletal Mesh를 카피한 Procedrual Mesh를 만들고 해당 Procedrual Mesh를 자르면 된다. 말은 간단하지만 알아야할 지식이 많다.일단 기본적으로 여기서 설명할 Mesh에 관련해서 간단하게 설명한다.이 절단을 구현하기 위해서 필요한 정보만 설명한다.이미 Skel.. 2025. 2. 24.