嗨,我开始学习directx12了。我对以前的版本一无所知。
我正在遵循这个示例程序HelloWorldTriangle,它渲染一个三角形。我想画一个矩形,
我变了
Vertex triangleVertices[] =
{
{ { 0.0f, 0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
{ { 0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } }
};
m_commandList->DrawInstanced(3, 1, 0, 0);至
Vertex triangleVertices[] =
{
{ { 0.0f, 0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
{ { 0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
{ { -0.25f, -0.3f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } },
{ { -0.25f, -0.2f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } },
};
m_commandList->DrawInstanced(4, 1, 0, 0);但是仍然画了一个不同角度的三角形..请解释一下我需要做些什么才能得到一个矩形。
如果你给我一些headstart directx12的链接或书籍,这对我会很有帮助。
提前谢谢..
https://stackoverflow.com/questions/38114321
复制相似问题