Cameraviewport and camerapick

Blitz3D Forums/Blitz3D Bug Reports/Cameraviewport and camerapick

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

Odd... I posted a reply to this and it seems to have gone...

This is not a bug. Camerapick picks using camera coordinates NOT mouse coords, so Camerapick(camera,0,0) actually picks at the top left of the cameras viewport. :)