Pass in a matrix that will retrieve the result of the function. The second parameter is the current view matrix. The three Singles are the position of the billboard's center. The fucntion will then compute an appropriate billboard matrix. You then multiply the resulting matrix by the vertices that make up the billboard itself. It should align the billboard to the camera.Code:Public Sub MatrixMatrixBillboardTranspose(result As D3DMATRIX8, a As D3DMATRIX8 , x As Single, y As Single, z As Single) result._11 = a._11 result._12 = a._21 result._13 = a._31 result._14 = 0.0 result._21 = a._12 result._22 = a._22 result._23 = a._32 result._24 = 0.0 result._31 = a._13 result._32 = a._23 result._33 = a._33 result._34 = 0.0 result._41 = x result._42 = y result._43 = z result._44 = a._44 End Sub
Z.




Reply With Quote