목록C++ (208)
응애맘마조
오늘은 강의 초기에 했었던 구 만들기로 돌아가서 광원에 대해 수업을 했었습니다. 먼저 정점 타입은 PCN으로 Position, Color, Normal입니다. #include "Common.hlsl" struct VertexInput { float4 Position : POSITION0; float4 Color : COLOR0; float4 Normal : NORMAL0; }; struct PixelInput { float4 Position : SV_POSITION; float4 Color : COLOR0; float4 Normal : NORMAL0; }; PixelInput VS(VertexInput input) { PixelInput output; output.Color = input.Color; o..
회전값에 대한 보간과 이미지의 투명도와 관련된 것과 관련해서 강의를 했습니다. #pragma once class Scene2 : public Scene { private: Camera* Cam; Grid*grid; Actor* player; Actor* plane; Actor*dead; Vector3 src, dest; float t; float dis; floatsrcR, destR; float tR; float disR; public: Scene2(); ~Scene2(); virtual void Init() override; virtual void Release() override; //해제 virtual void Update() override; virtual void LateUpdate() ove..
충돌 처리에 대한 것들을 이어서 했습니다. 게임을 만들 때 충돌 처리에 대한 상호작용이 많이 중요합니다. 이번엔 바닥을 따로 만들고 그 안에서 마우스 클릭으로 객체를 움직이는 방법에 대해서 했었습니다. if (INPUT->KeyDown(VK_RBUTTON)) { Ray CamToMouseRay; CamToMouseRay = Util::MouseToRay(INPUT->position, Camera::main); Vector3 hit; if (plane->Intersect(CamToMouseRay, hit)) { src = dead->GetWorldPos(); dest = hit; t = 0.0f; Vector3 disV = dest - src; dis = disV.Length(); dead->rotatio..
충돌 처리에 대해 강의를 했었습니다. #include "Common.hlsl" struct VertexInput { float4 Position : POSITION0; float4 Color : COLOR0; }; struct PixelInput { float4 Position : SV_POSITION; float4 Color : COLOR0; }; PixelInput VS(VertexInput input) { PixelInput output; output.Position = mul(input.Position, World); output.Position = mul(output.Position, ViewProj); output.Color = input.Color; return output; } float4..
저번엔 UI를 이미지로 나타내었지만 오늘은 게임 내 객체를 이미지로 나타내는 방법에 대해 강의했습니다. 그동안 2D 이미지를 애니메이션 효과로 나타낼 때는 스프라이트 이미지를 사용해 좌표를 빠르게 바꾸는 방식으로 했었지만 이번 3D에서는 위의 방식이 불가능하기 때문에 좌표를 바꾸지 않고 애니메이션 효과를 사용해야 됩니다. #pragma once class Mesh { friend class GameObject; private: ID3D11Buffer* vertexBuffer; ID3D11Buffer* indexBuffer; D3D_PRIMITIVE_TOPOLOGY primitiveTopology; VertexType vertexType; UINT byteWidth; public: UINT* indices..