Thursday, August 4, 2022
HomeGame Developmentdirectx11 - RTS sport object choice in DirectX 11 Strains

directx11 – RTS sport object choice in DirectX 11 Strains


After choosing an object, how would I’m going about drawing the traces across the object in display screen house.

enter image description here

I don’t know on what strategies to make use of. I should be pointed in the proper course how you’d put these traces/packing containers across the object after choosing the article utilizing choosing.

I’m studying “Programming an RTS sport with direct3d”
The ebook makes use of Directx 9 and plenty of stuff has modified since then.

That is the code pulled from the ebook, however it’s directx 9

D3DXVECTOR2 corner1[] = {D3DXVECTOR2(pmin.x, pmin.y + s), D3DXVECTOR2(pmin.x, pmin.y), D3DXVECTOR2(pmin.x + s, pmin.y)};
                    D3DXVECTOR2 corner2[] = {D3DXVECTOR2(pmax.x - s, pmin.y),
 D3DXVECTOR2(pmax.x, pmin.y), D3DXVECTOR2(pmax.x, pmin.y + s)};
                    D3DXVECTOR2 corner3[] = {D3DXVECTOR2(pmax.x, pmax.y - s), 
D3DXVECTOR2(pmax.x, pmax.y), D3DXVECTOR2(pmax.x - s, pmax.y)};
                    D3DXVECTOR2 corner4[] = {D3DXVECTOR2(pmin.x + s, pmax.y), 
D3DXVECTOR2(pmin.x, pmax.y), D3DXVECTOR2(pmin.x, pmax.y - s)};
            
    
                    ID3DXLine *line = NULL;
                    D3DXCreateLine(Machine, &line);
                    
            
                    //Draw the 4 corners
                    line->SetWidth(2.0f);
                    line->Start();
                    line->Draw(corner1, 3, 0xffffffff); 
                    line->Draw(corner2, 3, 0xffffffff); 
                    line->Draw(corner3, 3, 0xffffffff); 
                    line->Draw(corner4, 3, 0xffffffff); 
                    line->Finish();

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments