Участник
- Статус
- Онлайн
- Регистрация
- 30 Авг 2020
- Сообщения
- 709
- Реакции
- 402
C++:
void draw_circe(float x, float y, float radius, int resolution, DWORD color, DWORD color2, LPDIRECT3DDEVICE9 device)
{
LPDIRECT3DVERTEXBUFFER9 g_pVB2 = nullptr;
std::vector <CUSTOMVERTEX2> circle(resolution + 2);
circle[0].x = x;
circle[0].y = y;
circle[0].z = 0.0f;
circle[0].rhw = 1.0f;
circle[0].color = color2;
for (auto i = 1; i < resolution + 2; i++)
{
circle[i].x = (float)(x - radius * cos(D3DX_PI * ((i - 1) / (resolution / 2.0f))));
circle[i].y = (float)(y - radius * sin(D3DX_PI * ((i - 1) / (resolution / 2.0f))));
circle[i].z = 0.0f;
circle[i].rhw = 1.0f;
circle[i].color = color;
}
C++:
render::get().circle_filled(width / 2, height / 2 - 1, 4, 4, color);
render::get().circle_filled(width / 2 - 1, height / 1, 6, 6, color);
UPD: Круг есть, но такие треугольники по всему экрану.
Последнее редактирование: