1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
void DrawRectangle(float PosX, float PosY, float PosZ, float Width, float Height, float Depth, COLORREF Color = RGB(255,0,0), bool Filled = false)
{
if(Filled==false)
{
DrawLine( PosX, PosY, PosZ,PosX + Width, PosY, PosZ + Depth, Color);
DrawLine( PosX, PosY, PosZ, PosX, PosY + Height, PosZ, Color);
DrawLine( PosX + Width, PosY, PosZ + Depth, PosX + Width, PosY+Height, PosZ + Depth, Color);
DrawLine( PosX, PosY + Height, PosZ, PosX + Width, PosY + Height, PosZ + Depth, Color);
}
else
{
vector<Position3D> LeftVerticalLine = GetLinePoints3D({PosX,PosY,PosZ} , {PosX,PosY+Height,PosZ});
vector<Position3D> RightVerticalLine = GetLinePoints3D({PosX+Width,PosY,PosZ+Depth} , {PosX+Width,PosY+Height,PosZ+Depth});
for(size_t i=0;i<LeftVerticalLine.size(); i++ )
DrawLine(LeftVerticalLine[i].X,LeftVerticalLine[i].Y, LeftVerticalLine[i].Z, RightVerticalLine[i].X,LeftVerticalLine[i].Y, RightVerticalLine[i].Z, Color);
}
}
|