diff --git a/Code/Debug/Tester.ilk b/Code/Debug/Tester.ilk index 20d28e08..79772ebf 100644 Binary files a/Code/Debug/Tester.ilk and b/Code/Debug/Tester.ilk differ diff --git a/Code/Debug/Tester.pdb b/Code/Debug/Tester.pdb index 316043be..49977712 100644 Binary files a/Code/Debug/Tester.pdb and b/Code/Debug/Tester.pdb differ diff --git a/Code/OysterGraphics/Shader/HLSL/SimpleDebug/DebugCameraVertex.hlsl b/Code/OysterGraphics/Shader/HLSL/SimpleDebug/DebugCameraVertex.hlsl index 85456901..fadd7332 100644 --- a/Code/OysterGraphics/Shader/HLSL/SimpleDebug/DebugCameraVertex.hlsl +++ b/Code/OysterGraphics/Shader/HLSL/SimpleDebug/DebugCameraVertex.hlsl @@ -21,8 +21,8 @@ float4 main( VertexIn input ) : SV_POSITION float4 postTransform = float4(input.pos*0.1f,1); postTransform.y += 1.5f; //return postTransform; - return mul(float4(input.pos*0.1f,1), View); - //matrix VP = mul(Projection,View); + //return mul(View, float4(input.pos,1)); + matrix VP = mul(Projection, View); //matrix WVP = mul(World, VP); - //return mul(VP, float4(input.pos*0.01f,1)); + return mul(VP, float4(input.pos*0.1f,1) ); } \ No newline at end of file diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index ba427bb6..184ea1a7 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -392,7 +392,7 @@ namespace LinearAlgebra3D ::LinearAlgebra::Vector3 right = normalizedDirection.Cross( normalizedUpVector ).GetNormalized(); return ::LinearAlgebra::Matrix4x4( ::LinearAlgebra::Vector4( right, 0.0f ), ::LinearAlgebra::Vector4( right.Cross( normalizedDirection ), 0.0f ), - ::LinearAlgebra::Vector4( -normalizedDirection, 0.0f ), + ::LinearAlgebra::Vector4( normalizedDirection, 0.0f ), ::LinearAlgebra::Vector4( worldPos, 1.0f ) ); } diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index c46c9349..ad7d4774 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -143,40 +143,12 @@ HRESULT InitDirect3D() if(Oyster::Graphics::Core::Init::FullInit(g_hWnd,false,false)==Oyster::Graphics::Core::Init::Fail) return E_FAIL; - - - /*std::wstring ShaderPath = L"..\\OysterGraphics\\Shader\\HLSL\\"; - std::wstring EffectPath = L"SimpleDebug\\"; - - Oyster::Graphics::Core::ShaderManager::Init(ShaderPath + EffectPath + L"DebugPixel.hlsl",Oyster::Graphics::Core::ShaderManager::ShaderType::Pixel,L"Debug",false); - Oyster::Graphics::Core::ShaderManager::Init(ShaderPath + EffectPath + L"DebugVertex.hlsl",Oyster::Graphics::Core::ShaderManager::ShaderType::Vertex,L"PassThroughFloat4",false); - - Oyster::Graphics::Core::ShaderManager::Set::Vertex(Oyster::Graphics::Core::ShaderManager::Get::Vertex(L"PassThroughFloat4")); - Oyster::Graphics::Core::ShaderManager::Set::Pixel(Oyster::Graphics::Core::ShaderManager::Get::Pixel(L"Debug")); - - D3D11_INPUT_ELEMENT_DESC inputDesc[] = - { - { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 } - }; - - ID3D11InputLayout* layout; - - Oyster::Graphics::Core::ShaderManager::CreateInputLayout( inputDesc, 1, Oyster::Graphics::Core::ShaderManager::Get::Vertex(L"PassThroughFloat4"), layout); - - Oyster::Graphics::Core::deviceContext->IASetInputLayout(layout); - Oyster::Graphics::Core::deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - - Oyster::Graphics::Render::Preparations::Basic::BindBackBufferRTV();*/ - + //Init shaders Oyster::Graphics::Render::Resources::Init(); Oyster::Graphics::Render::Preparations::Basic::SetViewPort(); - - /*struct float4 - { - float x,y,z,w; - };*/ +#pragma region Triangle //Oyster::Graphics::Definitions::ObjVertex mesh[] = //{ // {Oyster::Math::Vector3(-1,1,0),Oyster::Math::Vector2(0,0),Oyster::Math::Vector3(1,1,0)}, @@ -199,17 +171,23 @@ HRESULT InitDirect3D() //mi->Indexed = false; //mi->VertexCount = 3; //mi->Vertices = b; - + + //m->info = mi; +#pragma endregion + +#pragma region Obj OBJReader or; or.readOBJFile(L"bth.obj"); m->info = or.toModel(); +#pragma endregion - - //m->info = mi; m->World = Oyster::Math::Matrix::identity; - P = Oyster::Math3D::ProjectionMatrix_Perspective(PI/4,16.0f/9.0f,1,100); - V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,-1.5f,0.0f)).GetInverse(); + P = Oyster::Math3D::ProjectionMatrix_Perspective(PI/2,16.0f/9.0f,.1f,100); + + V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,-1.5f,10.4f)); + V = Oyster::Math3D::InverseOrientationMatrix(V); + return S_OK; }