-
Notifications
You must be signed in to change notification settings - Fork 10
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
three dimensional cosmic text #104
Conversation
so cool... moving cursor by mouse click doesn't work... https://github.com/StaffEngineer/bevy_cosmic_edit/blob/2ea39ed6a11aac865305db3206acf0d370400808/src/input.rs#L148 considers only 2d for |
Yeah, gonna need to reverse project the mouse position or something raycasty |
In 3d example text is rendered to plane, in theory we could consider any shape, like rendering text on 3d sphere but then it becomes quite challenging, so restricting 3d for only plane surfaces is good first step. On mouse click we use this func for calculating I think it should be changed to https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html#method.viewport_to_world in case of 3d. Also this func may be useful https://docs.rs/bevy/latest/bevy/math/struct.Ray.html#method.intersect_plane if we consider only plane surfaces for now. |
I think interacting with the plane will generalize quite nicely to all shapes, we're only interested in the click's UV coords which shouldn't be too hard to get hold of. Might look into whether bevy_mod_picking gives the coords we need? Afk today tho so might be a while before I can check it all out |
Yeah, if we go with all shapes it makes sense to use existing solutions like |
this might be useful: https://github.com/tigregalis/bevy-intersect-plane |
any idea how to get UV coords? :) |
Having a mare with rebasing or something git related at the moment lol will be looking into this once I figure out how to put new changes on an old branch. Might just close this PR and make a new one save the headache |
update to latest main i still hate the online conflict resolver, need to look into how I make vim do that stuff instead
research keeps using big words like "parametric" and "orthogonal", i don't think I have the brainpower to tackle this today. tl;dr: maths make sam brain go sad |
@bytemunch have you seen https://github.com/tigregalis/bevy-intersect-plane ? there is basic math there for "parametric" and "orthogonal" I believe ;-) |
Does look very helpful, I'll see if I have time tomorrow to take a look with fresh eyes, hopefully things will make more sense then. I had a couple pieces of the puzzle but didn't get to the full solution, nice to know it's already been done and I can yoink in the name of open source! Does seem plane specific but I think we can leave typing on spheres to a future endeavour. Nice that it doesn't depend on any raycast plugins too, keeps footprint small :D |
Let's re-open if/once active :) |
closes #98
Bit jank at the moment, considering either adding StandardMaterial cases to the render function, or reworking how the render function draws.
Todo: