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

Use view.view_proj for world projection #4

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

giraugh
Copy link
Contributor

@giraugh giraugh commented Jun 2, 2024

Hi there! I was checking this out and seeing how it could fit into my project when I found a small issue with the world->screen projection not respecting the camera transform.

I'm not 100% on top of bevy rendering logic but from referencing bevy's sprite shaders seems like using view.view_proj instead of view.projection includes the camera's transform as well the "camera projection".

Summary

  • Use view.view_proj instead of view.projection for world_to_screen()

Copy link
Owner

@jgayfer jgayfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you! Tested it out and you're right, this is how we should be converting to screen space.

I'll cut a release 👍

Edit: v0.1.3 is on Crates.io now

@jgayfer jgayfer merged commit 1691ab8 into jgayfer:main Jun 2, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants