목록공부/3D강의 (101)
응애맘마조
필기시험을 치뤘던 관계로 강의는 따로 없었습니다.
어제에 이어서 다익스트라에 대해 강의했습니다. 오늘은 완성이 되었습니다. 동시에 과제였습니다. bool IntersectCollider(Ray WRay); int GetDiNodeIdx(Vector3 pos); 터레인 헤더 파일에서 장애물을 놓았을 때 피해서 가는 길을 만들기 위해 충돌 함수와 경유하는 노드를 찾는 함수를 만들었습니다. int Terrain::GetDiNodeIdx(Vector3 pos) { int idx = 0; float min = FLT_MAX; for (auto it = di.list.begin(); it != di.list.end(); it++) { Vector3 minus = it->second->pos - pos; if (min > minus.Length()) { min = ..
노드 연결에 이어서 길 찾는 방법에 대해서 강의했습니다. 하지만 거의 코드가 터지는 일이 많아 고치다가 끝나서 내일 이어진다고 합니다. #pragma once class Terrain : public Actor { struct InputDesc { UINT index; Vector3 v0, v1, v2; }; struct OutputDesc { int picked; float u, v, distance; }; struct RayDesc { Vector3 position; float size; Vector3 direction; float padding; }; static ID3D11ComputeShader* computeShader; static class Actor* Node; static class A..
임의의 노드에 노드를 위치시키고 간선으로 연결시키는 것을 강의했습니다. 동시에 과제였습니다. #pragma once class DiNode { friend class Di; private: int id; bool find; //검색한적 있는가? int prev; //내가 갱신된 노드 public: unordered_map linkedList; Vector3 pos; float cost; //현재까지 비용 DiNode(int id) { this->id = id; } void Link(int node, float cost) { linkedList[node] = cost; } void Reset() { prev = -1; cost = FLT_MAX; find = false; } }; c..

다익스트라 알고리즘을 사용해서 어제는 콘솔창에 띄우는 것을 했지만, 오늘은 DirectX 창에 띄우는 것까지 했습니다. #pragma once class DiNode { friend class Di; private: int id; bool find; int prev; public: unordered_map linkedList; Vector3 pos; float cost; { this->id = id; } void Link(int node, float cost) { linkedList[node] = cost; } void Reset() { prev = -1; cost = FLT_MAX; find = false; } }; class DiNodeCompare { public: bool ..