camerapick with a second camera
Blitz3D Forums/Blitz3D Programming/camerapick with a second camera
| ||
Hi all, I've a problem with th next stuff. I create two cameras at the beginning with different wiewports but the same projection (one at the left of the screen and the other one at the right), trying to show a "windowed" aspect in order to could perform "camerapick" actions in each window. The problem comes when I try to do camerapick camera2,mousex(),mousey() ... The coordinates returned in pickedx()....etc... are wrong, and the ball that I would like to put where the user makes click are displace in then X axis. Please, what could I do for solve this issue?? Thanks in advance!! |
| ||
Instead of directly working with MouseX() and MouseY(), could you read the values into variables (mx and my???) - The slowdown is quite minimal! This way you can adjust your mx value. |
| ||
You need to remove the CameraViewport offset from the mouse positions. So if your second camera has it's viewport set to: 200,30,100,100 You should use: CameraPick camera2,MouseX()-200,MouseY()-30 |
| ||
Thanks a lot both!, Really is a stupid solution I cannot understand how I could not achieve it before... Thanks a lot again!!! :))) Thanks!!!!! |