jeudi 30 janvier 2014

[Question] i wonder why drawline function is getting me this for drawing a skeleton topic




ok first lets have a look in the drawprimitive function for the line that i use



PHP Code:







void DrawPhokingSkeleton(IDirect3DDevice9m_pD3Ddevfloat Xfloat Yfloat Xxfloat Yyfloat widthD3DCOLOR Color)
{
    
D3DTLVERTEX qV[2] = {
        { (float)
Xx, (float)Yy0.0f1.0fColor },
        { (float)
X, (float)Y0.0f1.0fColor }    
    };
    const 
DWORD D3DFVF_TL D3DFVF_XYZRHW D3DFVF_DIFFUSE D3DFVF_TEX1;
    
m_pD3Ddev->SetRenderState(D3DRS_ALPHABLENDENABLEtrue);
    
m_pD3Ddev->SetRenderState(D3DRS_DESTBLENDD3DBLEND_INVSRCALPHA);
    
m_pD3Ddev->SetFVF(D3DFVF_TL);
    
m_pD3Ddev->SetTexture(0Primitive);
    
m_pD3Ddev->DrawPrimitiveUP(D3DPT_LINELIST1qVsizeof(D3DTLVERTEX));










then let's have a look into the phucking function that i use to get the crappy bones ^^... Tell me if i have too many :D i draw a box if ennemy is more than 50 and then it changes to skeleton if closer.. cause i expect lags if i draw only phoking skeletons :P


PHP Code:







//..............rest of function.........
pSoldier->GetTransform(&mTransform);
        
D3DXVECTOR3 vTargetPosition mTransform.m[3];
         
distance Vdistance(pSoldierlSoldier);
        if (
WorldToScreen2(&vTargetPosition)) {
            
D3DXVECTOR3vBones = new D3DXVECTOR3[0xD0];
            if(
pPlayer && distance 50)//->m_teamId != lPlayer->m_teamId)
            
{
                for (
unsigned int i 00xD0i++)
                {
                    if (
i>)
                    {
                        if(
pControlled->isVisible())
                        {
                            
DrawPhokingSkeleton(dx_DevicevBones[i].xvBones[i].yvBones[1].xvBones[1].y,18Red);
                        }
                        else
                        {
                            
DrawPhokingSkeleton(dx_DevicevBones[i].xvBones[i].yvBones[1].xvBones[1].y18orangetz2);
                        }        
                    }
                    
GetBone(pSoldier, &vBones[i], UpdatePoseResultData::rHips i);
                    if (
WorldToScreen2(&vBones[i]))continue;
                }
//............rest of function....... 









:shrug:
i really wonder why the result look like that :





Aucun commentaire:

Enregistrer un commentaire