Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen_to_world and FarZ #71

Open
zendorx opened this issue Apr 15, 2024 · 2 comments
Open

screen_to_world and FarZ #71

zendorx opened this issue Apr 15, 2024 · 2 comments

Comments

@zendorx
Copy link

zendorx commented Apr 15, 2024

Hello! I have question, but probably it is some kind of issue.
I set FarZ = 1000, set projection to FIXED_ZOOM and rotated camera (-30, 0, 0)

Since I want to place all GO in 3d space I want to raycast to it. But I noticed that function screen_to_world returns different coordinates for mouse position if change FarZ (nothing else changed)

Снимок экрана 2024-04-15 в 15 28 44

I think that if camera stay on one place and ortographic size is same then world coordinates of mouse should remain same

@zendorx zendorx changed the title screen_to_world screen_to_world and FarZ Apr 15, 2024
@zendorx
Copy link
Author

zendorx commented Apr 15, 2024

Update, if FarZ + NearZ == 0 than world position is right in space of camera object. But if NearZ -1 and FarZ 5000 than it returns coordinate far from camera for 2500 points

@britzl
Copy link
Owner

britzl commented Apr 18, 2024

I haven't looked into this very closely but it is likely that the screen to world calculation is not correct when the camera is rotated on the x or y axis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants