Pickable objects

Blitz3D Forums/Blitz3D Programming/Pickable objects

Moraldi(Posted 2007) [#1]
Hi again,
I have two B3D models set with EntityPickMode, 2. Because the first one is bigger (they are placed in the same position on the 3D scene) Blitz3D can't pick the second. I tried to set the first alpha value less than 1.0 but it didn't work.
Can someone help?

Thanks


Leto(Posted 2007) [#2]
I don't know if this is the "best" way but you could try hiding the bigger entity, doing your pick, then unhiding it again.

HideEntity ent
<your picking command>
ShowEntity ent


Zethrax(Posted 2007) [#3]
Changing the alpha value wont have any effect, Moraldi, as alpha doesn't affect any of the dynamics stuff.

Another way to do it would be to first do a pick. If something was picked then whatever maximum distance you want the pick to be wasn't reached, so store the entity handle of the picked entity along with the distance to the picked point, and do another pick in the same direction as the first but a few centimetres past the point that was picked, so that the entity you just picked doesn't get picked again. Rinse and repeat until the accumulated distance picked is greater than the max distance you want to pick. You may want to sort through the stored entity handles to remove duplicates as concave meshes may get picked more than once.

Something to be aware of is that the backfaces of polygons and the insides of collision volumes aren't collidable or pickable (which is a good thing in this case). Moving or animating meshes won't pick or collide against reliably, either, as only ellipsoids can be collision source entities.


Stevie G(Posted 2007) [#4]
What is it you're doing? There may be a better solution.

BTW PickedTime() tells you the fraction of how far the pick got to maximum length of pick vector .. so if this value if 1.0 it got to it's maximum distance.

Stevie


Zethrax(Posted 2007) [#5]
Nice tip about 'PickedTime' Stevie. I'll have to try that out.


Moraldi(Posted 2007) [#6]
Take a look to the Unlimited Drop link from http://www.freewebs.com/moraldi/
a) Insert from media folder the crate model and then press [S] to go in Scale mode.
b) Drag with the mouse one of the 3D axes to change the size of the crate. If the crate becomes too large then I cannot drag again one of the axes, because Blitz3D cannot pick an axis

Note:
With [M] you can go to Move mode and [R] to rotate mode.
You can navigate the camera holding the [ALT] key and playing with the mouse...


Stevie G(Posted 2007) [#7]
Why do you have the cube mesh pickable in the first placel?

If it's really necessary then just set it to unpickable when in S, M or R mode and this will resolve your issues.

Stevie


Moraldi(Posted 2007) [#8]
Stevie G: You mean to set unpickable after the user has selected it?


Moraldi(Posted 2007) [#9]
Thanks to all of you for your replies, but specially to you Steve G. It works!. When the user selects an object then I make this object unpickable and when deselect I make it again pickable. I have upload the new exe fixed