Pick an object
Blitz3D Forums/Blitz3D Beginners Area/Pick an object
| ||
Hi, Suppose we have mesh A hidden by SEVERAL meshes B,C,D etc. (as we are looking them from the Camera) Is it possible to check if mesh A has been picked by the Camera (using Mouse Screen Coordinates) without making other meshes B,C,D... 'unpickable'? Thanks |
| ||
Are you saying you want to be able to pick A, even if it's being obscured by B,C,D? If so, you'll have to hide B,C,D before doing the pick, if you dont want to make B,C,D unpickable. Alternatively, if you just want to pick from the centre of the screen, you could use EntityVisible(cam,A), ensuring that B,C,D haven't been set as obscurers when setting their pick mode. |
| ||
You COULD: REPEAT Do a pick Get pickedX() pickedY() pickedZ() UNTIL pickedlength > specified_distance Basically, do a pick. If it's below a certain length, redo the pick from the picked() co-ords. That way, It keeps picking through items, until the one you want is found, or until the length of pick is too great that nothing else will be found. |
| ||
Thanks guys. I think I will follow Ross C's solution |
| ||
Mind if it's a camerapick(), you'll need to move the camera to the picked location and redo the pick from there. Also to remember to save your cameras orginal co-ords :o) |
| ||
Not really You can calculate the pick direction with the first pickedxyz and the entityxyz of the camera and use linepick afterwards |
| ||
I missed that too. Thanks! |