Question on LINEPICK

Blitz3D Forums/Blitz3D Programming/Question on LINEPICK

Jack(Posted 2011) [#1]
I have created a sphere and scaled it by a factor of 20.

Next I search with LinePick command to find that sphere.

It seems to me that the LinePick only registers a hit when I point it right at the center of that sphere.

So.. Does that command ignore the scaling?
Would using a sphere created from a mesh solve this?
Or is there a better way?

Or,heaven forbid,is that command just fubar.


Matty(Posted 2011) [#2]
Linepick works fine. Post some code so we can have a look. Have you set the spheres pick mode? Should be polygon mode


Jack(Posted 2011) [#3]
yep pickmode 2


big10p(Posted 2011) [#4]
As Matty said, Linepick works just fine.


Ross C(Posted 2011) [#5]
Does scalemesh need to be used, rather than scale entity? It's been a while since I used it, but it does work fine :)


Jack(Posted 2011) [#6]
Ross C.

Thanks.I'll give that a try today.
I've used blitz for many years but been away for a couple now.

It does seem to me I remember seeing this "scaling" problem with linepick at that time. Searched the forums earlier but found nothing.

I will get back with the results.


Yasha(Posted 2011) [#7]
Linepick should work with entity scale - if it doesn't, that's probably a bug.

On the other hand... Linepick's also really, really slow. My own preference for a while has been to ditch it altogether and use ColDet.


Jack(Posted 2011) [#8]
practice=creatsphere()
scaleentity practice 20,20,20
PositionEntity pract,1040,40,600
entitypickmode practice,2

LinePick(1040,20,400,1040,20,1100,10)
cc=PickedEntity()
If cc<>0 Then Stop

NO ENTITY GETS PICKED....WHATS UP

By the way,in my code,if the another entity colides with "practice" anywhere in the scaled range it reacts properly no matter where it hits.So there is no problem with constructing the entity although the above may not include all the details.

Thanks for any help. As I recall reading "linepick" might get messed-up in locating an item properly.


Ross C(Posted 2011) [#9]
Remember your last 3 parameters in the linepick code are vectors. You don't specifiy co-ords.


Jack(Posted 2011) [#10]
Oh jeez. I had that ok for the "Z" element but of course "X" and "Y" were wrong. Stupid is as Stupid does.

Thanks so much Ross. You having been helping out here since I can remember. And thanks to you others for the answers also.


Ross C(Posted 2011) [#11]
Nps man!