Originally Posted by
ves23
Using viewprojection & localtoworld, no boxes are being drawn, heres the full shader log pastebin.com/1m39x6a5
Log says 230, I assume it's correct. It is usually 230-233 in ue3 engine games.
Code:
struct ModelInfo_t
{
float vOutX, vOutY;
};
std::vector<ModelInfo_t>ModelInfo;
float aimheight = 70.0f;
void AddModel(LPDIRECT3DDEVICE9 pDevice)
{
D3DVIEWPORT9 Viewport;
pDevice->GetViewport(&Viewport);
D3DXMATRIX ProjMatrix, ViewMatrix, WorldMatrix;
D3DXVECTOR3 vOut(0, 0, 0), vIn(0, 0, aimheight);
pDevice->GetVertexShaderConstantF(0, ProjMatrix, 4);
pDevice->GetVertexShaderConstantF(230, ViewMatrix, 4);
D3DXMatrixIdentity(&WorldMatrix);
D3DXVec3Project(&vOut, &vIn, &Viewport, &ProjMatrix, &ViewMatrix, &WorldMatrix);
if (vOut.z < 1.0f)
{
ModelInfo_t pModelInfo = { static_cast<float>(vOut.x), static_cast<float>(vOut.y) };
ModelInfo.push_back(pModelInfo);
}
}
Code:
if (ModelInfo.size() != NULL)
{
for (int i = 0; i < ModelInfo.size(); i += 1)
{
if (ModelInfo[i].vOutX > 1)
{
DrawCornerBox(Device, (int)ModelInfo[i].vOutX, (int)ModelInfo[i].vOutY+20, 20, 30, 2, D3DCOLOR_ARGB(255, 255, 255, 0));
}
}
}
ModelInfo.clear();