it seems that cameraviewport interferes with camerapick
Graphics3D 640,480,16,2
SetBuffer BackBuffer()
cube=CreateCube()
EntityPickMode cube,2
camera=CreateCamera()
CameraViewport (camera,0,60,640,420)
PositionEntity camera,0,0,-30
While Not KeyDown(1)
Cls
If MouseHit(1)
ent=CameraPick (camera,MouseX(),MouseY())
EndIf
UpdateWorld
RenderWorld
Text 30,30,ent+" picked entity"
Flip
Wend
End
if you click about 60 pixels above the box, it returns the picked entity. Because the cameraviewport is 60 pixels down the screen
|