Dim vDir As Vector3 = Vector3.Subtract(CCamera.CameraView, CCamera.CameraPosition)
If vDir.X > 0.0F Then
billboardMatrix = Matrix.RotationY(CSng(-Math.Atan((vDir.Z / vDir.X)) + Math.PI / 2))
Else
billboardMatrix = Matrix.RotationY(CSng(-Math.Atan((vDir.Z / vDir.X)) - Math.PI / 2))
End If
billboardMatrix.M41 = object.X
billboardMatrix.M42 = object.Y
billboardMatrix.M43 = object.Z
d3dDevice.Transform.World = billboardMatrix