Directx circle head

Статус
В этой теме нельзя размещать новые ответы.

TrollingYT

Новичок
Автор темы
2
0
Hi guys i started today my first question .im new on the forum so...Today i wanna know if anyone know how to create a simple directx circle for add to the player head in sobeit.
 

pabloko

Новичок
6
5
Hi, you should handle a frame by frame drawing, just take a look into proxyIDirect3D9.cpp, you may user render-> to draw your stuff, since only DrawBox and DrawBoxi is defined in d3drender.cpp you should add DrawCircle method, that should look like this:

PHP:
void DrawCircle(float mx, float my, float r, D3DCOLOR colour)
{
    static const int CIRCLE_RESOLUTION = 10;
    D3DVertex verts[CIRCLE_RESOLUTION];
 
    for (int i = 0; i < CIRCLE_RESOLUTION; ++i)
    {
        verts[i].X = mx + r * cos(D3DX_PI * (i / (CIRCLE_RESOLUTION / 2.0f)));
        verts[i].Y = my + r * sin(D3DX_PI * (i / (CIRCLE_RESOLUTION / 2.0f)));
        verts[i].Z = 0.0f;
        verts[i].RHW = 1.0f;
        verts[i].Colour = colour;
        verts[i].U = 1.0f;
        verts[i].V = 1.0f;
    }
 
    d3ddevice->SetFVF(VERTEX_FVF);
    d3ddevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, CIRCLE_RESOLUTION - 2, verts, sizeof(D3DVertex));
}

Then you should get the main actor camera CVector and the game Camera CVector, match them and draw what you want. As example for this you may want to look into clickwarp() method

PHP:
vecOrigin = *pGame->GetCamera()->GetCam(pGame->GetCamera()->GetActiveCam())->GetSource();....

You can do this drawing stuff at the end of renderHandler() method... skype: djmorpheox
 
Статус
В этой теме нельзя размещать новые ответы.