I use this function to pick an object in the 3D View:
With this function I can only get objects that is loaded as a Mesh, but when I load an object as AnimationSet, the pick function won't work.Code:Public Function Pick(X As Long, Y As Long) As Direct3DRMFrame3 Dim PickArray As Direct3DRMPickArray Dim FA As Direct3DRMFrameArray Dim F As Direct3DRMFrame3 Dim P As Direct3DRMFrame3 Dim PickDesc As D3DRMPICKDESC Dim R As Integer, C As Integer, Q As Integer Dim strName As String Set PickArray = Viewport.Viewport.Pick(X, Y) If PickArray.GetSize() = 0 Then Exit Function Set FA = PickArray.GetPickFrame(0, PickDesc) Set F = FA.GetElement(FA.GetSize() - 1) Set Pick = F End Function
Thanks





Reply With Quote