Friday, August 5, 2022
HomeGame Developmentdirectx11 - How to attract the traces across the object in display...

directx11 – How to attract the traces across the object in display house?


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

enter image description here

I do not know on what strategies to make use of. I should be pointed in the fitting course how you’ll put these traces/containers across the object after selecting the thing utilizing selecting.

I’m studying “Programming an RTS sport with direct3d”
The ebook makes use of Directx 9 and many 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(Gadget, &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