How find player.Camera? Else how call WorldToViewPort(...)?
[DOUBLEPOST=1463774113][/DOUBLEPOST]I found cpp function, maybe it will help
- boolWorldToScreen(D3DXVECTOR3 origin, D3DXVECTOR2 *out)
- {
- D3DXMATRIX temp;
- D3DXMatrixTranspose(&temp,&viewMatrix);
- D3DXVECTOR3 translationVector = D3DXVECTOR3(temp._41, temp._42, temp._43);
- D3DXVECTOR3 up = D3DXVECTOR3(temp._21, temp._22, temp._23);
- D3DXVECTOR3 right = D3DXVECTOR3(temp._11, temp._12, temp._13);
- float w = D3DXVec3Dot(&translationVector,&origin)+ temp._44;
- if(w <0.098f)
- returnfalse;
- float y = D3DXVec3Dot(&up,&origin)+ temp._24;
- float x = D3DXVec3Dot(&right,&origin)+ temp._14;
- out->x =(res[0]/2)*(1.f+ x / w);
- out->y =(res[1]/2)*(1.f- y / w);
- returntrue;
- }
Camera.WorldToViewPort
Discussion in 'Rust Development' started by bazuka5801, May 20, 2016.
