EMO Style ForumPro - Hos Geldiniz
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 202 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: AnthonyFurey3

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Kimler hatta?
Toplam 4 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 4 Misafir :: 1 Arama motorları

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 92 kişi Paz Ağus. 28, 2016 6:58 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

D3D 3D Box - Draw Function

Önceki başlık Sonraki başlık Aşağa gitmek

D3D 3D Box - Draw Function

Mesaj tarafından Hello EMO Bir C.tesi Ara. 11, 2010 4:03 am

[quote name='RiSiCO' timestamp='1208537000' post='9482']
Hi guys,

i dont know if it is needed by anybody but i searched around 1 whole day on the net for a 3D Box function and couldnt find it. Thats why i carried on with it myself and here are the results.
Its only the Draw function, that means that you need to give your own parameters of your source etc to it. For example bones.


Here is a picture, that you see which points you have to give to the Draw Function, i am not a paint expert but i think its possible to see what i mean.
[URL="http://img385.imageshack.us/img385/4403/boundingboxog9.th.jpg"]http://img385.imageshack.us/img385/4...gboxog9.th.jpg[/URL]

And the following is the code which you need for the draw function. If you give the parameters correctly it should draw a 3D box around the parameters you give in Wink.



Kod:
//declaration stuff
ID3DXLine  *pLine; //Liner


//here is the functions body
void Draw3DBox(float x_bottom_left, float y_bottom_left, float x_bottom_right, float y_bottom_right, float x_top_left, float y_top_left, float x_top_right, float y_top_right, float x_forward_bottom_left, float y_forward_bottom_left, float x_forward_bottom_right, float y_forward_bottom_right, float x_forward_top_left, float y_forward_top_left, float x_forward_top_right, float y_forward_top_right, int a, int r, int g, int b)
{
    if(!IsBadReadPtr(pLine, sizeof(ID3DXLine)))
    {
        D3DXVECTOR2 vLine1[2];
        D3DXVECTOR2 vLine2[2];
        D3DXVECTOR2 vLine3[2];
        D3DXVECTOR2 vLine4[2];
        D3DXVECTOR2 vLine5[2];
        D3DXVECTOR2 vLine6[2];
        D3DXVECTOR2 vLine7[2];
        D3DXVECTOR2 vLine8[2];
        D3DXVECTOR2 vLine9[2];
        D3DXVECTOR2 vLine10[2];
        D3DXVECTOR2 vLine11[2];
        D3DXVECTOR2 vLine12[2];

        float t=1;
        pLine->SetWidth( t );
        pLine->SetAntialias( false ); 
        pLine->SetGLLines( false );

        //bottom left to bottom right
        vLine1[0].x = x_bottom_left;
        vLine1[0].y = y_bottom_left;
        vLine1[1].x = x_bottom_left+(x_bottom_right-x_bottom_left);
        vLine1[1].y = y_bottom_left;

        //bottom left to top left
        vLine2[0].x = x_top_left;
        vLine2[0].y = y_top_left;
        vLine2[1].x = x_top_left;
        vLine2[1].y = y_top_left+(y_bottom_left-y_top_left);

        //bottom right to top right
        vLine3[0].x = x_top_right;
        vLine3[0].y = y_top_right;
        vLine3[1].x = x_top_right;
        vLine3[1].y = y_top_right+(y_bottom_right-y_top_right);

        //top left to top right
        vLine4[0].x = x_top_left;
        vLine4[0].y = y_top_left;
        vLine4[1].x = x_top_left+(x_top_right-x_top_left);
        vLine4[1].y = y_top_left;

        //from top left to top left forward
        vLine5[0].x = x_top_left;
        vLine5[0].y = y_top_left;
        vLine5[1].x = x_top_left+(x_forward_top_left-x_top_left);
        vLine5[1].y = y_top_left+(y_forward_top_left-y_top_left);

        //from bottom left to bottom left forward
        vLine6[0].x = x_bottom_left;
        vLine6[0].y = y_bottom_left;
        vLine6[1].x = x_bottom_left+(x_forward_bottom_left-x_bottom_left);//
        vLine6[1].y = y_bottom_left+(y_forward_bottom_left-y_bottom_left);//

        //from bottom right to bottom right forward
        vLine7[0].x = x_bottom_right;
        vLine7[0].y = y_bottom_right;
        vLine7[1].x = x_bottom_right+(x_forward_bottom_right-x_bottom_right);//
        vLine7[1].y = y_bottom_right+(y_forward_bottom_right-y_bottom_right);//

        //from top right to top right forward
        vLine8[0].x = x_top_right;
        vLine8[0].y = y_top_right;
        vLine8[1].x = x_top_right+(x_forward_top_right-x_top_right);//
        vLine8[1].y = y_top_right+(y_forward_top_right-y_top_right);//

        //bottom left forward to bottom right forward
        vLine9[0].x = x_forward_bottom_left;
        vLine9[0].y = y_forward_bottom_left;
        vLine9[1].x = x_forward_bottom_left+(x_forward_bottom_right-x_forward_bottom_left);
        vLine9[1].y = y_forward_bottom_left;

        //bottom left forward to top left forward
        vLine10[0].x = x_forward_top_left;
        vLine10[0].y = y_forward_top_left;
        vLine10[1].x = x_forward_top_left;
        vLine10[1].y = y_forward_top_left+(y_forward_bottom_left-y_forward_top_left);

        //bottom right forward to top right forward
        vLine11[0].x = x_forward_top_right;
        vLine11[0].y = y_forward_top_right;
        vLine11[1].x = x_forward_top_right;
        vLine11[1].y = y_forward_top_right+(y_forward_bottom_right-y_forward_top_right);

        //top left forward to top right forward
        vLine12[0].x = x_forward_top_left;
        vLine12[0].y = y_forward_top_left;
        vLine12[1].x = x_forward_top_left+(x_forward_top_right-x_forward_top_left);
        vLine12[1].y = y_forward_top_left;

        pLine->Begin( );
        pLine->Draw( vLine1, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine2, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine3, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine4, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine5, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine6, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine7, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine8, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine9, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine10, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine11, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->Draw( vLine12, 2, D3DCOLOR_ARGB(a, r, g, b ) );
        pLine->End( );
    }
}

//following you put in endscene for example:
D3DXCreateLine(d3dDevice, &pLine ); //Create line (put that for example in endscene or whatever you hooked

//and last but not least lets call our function:
Draw3DBox( /*all parameters for example bones*/ );

Of cause its possible to use Vectors on that function but i tried to keep it as simple as i could.
It shouldnt be a problem to rewrite it cause i hope the function and a grasp of c++ is at hand.

In the case there are questions, reply right here,
CES
[/quote]


Hello Kitty
vs
eMoStyLe



avatar
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 244693
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 27
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Kullanıcı profilini gör http://emostyle.myforumpro.com

Sayfa başına dön Aşağa gitmek

Önceki başlık Sonraki başlık Sayfa başına dön


 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz