entitypick dependent on entitysize?

Blitz3D Forums/Blitz3D Programming/entitypick dependent on entitysize?

slenkar(Posted 2003) [#1]
Is there any relation to the length of a entitypick to the size of the entity that picks??

I have 2 identical entities in my game right next to each other and they are both set to '80' length.

They are picking at different distances though, the smaller picks half the distance of the larger entity


Shambler(Posted 2003) [#2]
What entitypick mode do the entities use?

If it is sphere or box maybe you need to change entity radius/box to suit the scale of the entity.

If it is polygon there shouldn't be a problem.


slenkar(Posted 2003) [#3]
they all use radius, does this affect how far an entity picks?

The are picking the same entity.

One of the entities that is picking is a copy but scaled down to half the size.

Also im getting some weird results with the larger one which is scaled up 1.5 compared the loaded model.

How much slower is polygon picking compared to sphere or box?

EDIT-
After some experiments I found that scaling the entity messes up the entitypicking - which is strange.


Shambler(Posted 2003) [#4]
Scale does indeed affect pick range.

Try this demo, use up and down arrow to change scale.

Graphics3D 800,600,32
SetBuffer BackBuffer()

cam=CreateCamera()
s1=CreateSphere()
s2=CreateSphere()
c1=CreateCube()

PositionEntity cam,-50,50,0
PointEntity cam,c1

EntityPickMode c1,1,False

PositionEntity s1,0,0,20
PositionEntity s2,0,0,-20
PointEntity s1,c1
PointEntity s2,c1


s#=1
While Not KeyHit(1)

If KeyDown(200) Then s=s+0.1
If KeyDown(208) Then s=s-0.1

ScaleEntity s2,s,s,s

RenderWorld
Text 0,0,"s1-c1 "+EntityPick(s1,10)
Text 0,20,"s2-c1 "+EntityPick(s2,10)
Text 0,40,"scale of s2 "+s
 
Flip

Wend




slenkar(Posted 2003) [#5]
Yep, is this a bug or a feature?


Shambler(Posted 2003) [#6]
Its a suprising but I suppose natural feature.

I remember once I had the camera parented to a sphere and scaling the sphere caused the camera to zoom...unexpected but I suppose it's just the way it is and once you know then you just have to code around it.


slenkar(Posted 2003) [#7]
It should be mentioned in the help files at least