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

Restructure app as a Godot asset plugin available to other games (and VR) #207

Open
goatchurchprime opened this issue Oct 9, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@goatchurchprime
Copy link

Feature/enhancement description:

There could be other (possibly networked) games where the player might want to make a quick doodle for a treasure map, mark a document with their signature, or leave graffiti on a wall, or anything else like that.

Having a good standard efficient drawing module that just plugs in to any Godot project could save a lot of time in setting up experiments with this sort of mechanic.

I am particularly interested in experimenting with the possibility of making 2D drawings in AR/VR using hand and finger tracking against an empty desk where one hand draws the shapes and the other hand simultaneously moves the "paper" and changes the scale.

In VR and other 3D applications, we use a Viewport to convert the 2D view into a texture which is then projected onto a 3D plane, and then calculate the relative points of intersection/interaction with that 3D plane to construct mouse events that are called back into the 2D view. We might therefore prefer to have two separate Viewports, one for the UI and one for the zooming infinite canvas.

As a Godot asset, most of the code would be in an addons directory, with a simple main project to demo it in exactly the form it is now. I'll report back here if I get anywhere with my project using this as a starting point, though I don't expect any of my hacking to be salvageable.

@goatchurchprime goatchurchprime added the enhancement New feature or request label Oct 9, 2022
@goatchurchprime
Copy link
Author

I've moved a bunch of the directories in my fork into an addons directory using the Godot file-system box, and it magically updates all the scene instantiation pointers. How cool is that! https://github.com/goatchurchprime/LorienAsset/tree/godot-asset-version

@goatchurchprime
Copy link
Author

Got it working! https://www.youtube.com/watch?v=TTruk5-R-Z0

The next job is to map the fingers into Mouse Motions instead of the laser pointer. (The plan is to use the left hand for moving and zooming, and the right hand fingers to draw things. I simply need to issue the correct InputEvents, because I've proven that your app responds to the zoom wheel even as it's drawing.)

Almost no changes to the code were necessary, which is how to get productivity -- by not rewriting anything that can be made to work.

My only problem was in the XR toolkit library where it incorrectly sets up the InputEventMouseButton objects GodotVR/godot-xr-tools#199

Also, it would probably a good idea to cut down on those AutoLoaded classes. You can put them in the same place as the BrushTool, etc, and get to them via _canvas.get_node("Settings"), which is ugly, but does mean it would play nicer as a plugin.

Another feature that I'll need to add from the outside is networking. I've got a general project that does this here:
https://github.com/goatchurchprime/godot_multiplayer_networking_workbench
There's a WebRTC interface, which means the link could be operated serverless peer-to-peer to turn it into a drawing etherpad. All it requires are functions to incrementally save and load the entities instead of the whole drawing.

@goatchurchprime
Copy link
Author

Experiment complete. https://www.youtube.com/watch?v=69gGKHGgtQo
It's a bit like working with a wet paint brush. A lot of tuning and work will be necessary to make this good enough to be on par with hand-writing with a pen. I'd like oit to be capable of replicating those Khan Acadamy style lectures.

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

No branches or pull requests

1 participant