Add some instructions in README

This commit is contained in:
rodolpheh 2023-10-24 22:49:32 +01:00
parent c31fc6b2b3
commit 29740c9af4

View file

@ -1,13 +1,60 @@
# :raised_hands: Godot Ultraleap Plugin
A GDExtension plugin to use Ultraleap hand tracking in your project. See GIF below for current status.
A GDExtension plugin to use Ultraleap hand tracking in your project. See GIF below for very old status (it does more now!).
- [:sunflower: About](#sunflower-about)
- [:hammer\_and\_wrench: Build](#hammer-and-wrench-build)
- [:fast\_forward: Quick start](#fast-forward-quick-start)
![GIF of Ultraleap hand tracking in Godot](res/ul-godot.gif)
# :hammer_and_wrench: Build
## :sunflower: About
Use SConstruct to build. More instructions to come.
This GDExtension aim at exposing and abstracting the LeapC API to make Ultraleap's hand tracking available in Godot, for any kind of use. Out of the box Godot supports hand tracking through OpenXR, however that means it's only accessible for people who wants to use it for XR. Ultraleap's hand tracking is capable of tracking hands in two extra setups:
* Tabletop or "Desktop", flat on a desk pointing up
* "Screentop", on top of a monitor, pointing downward or with an angle of maximum 30 degrees
The priorities of this project is to target the most useful features of Ultraleap's hand tracking while exploring how hand tracking can be used in Godot. Because of this, there are demos and scripts that are not part of the extension but are part of the project. Some of the scripts implements new features or features related to the game engine rather than the hand tracking itself: displaying joints, rigging a skeleton etc... If possible, and when the project has matured enough, some of those extra features could be ported to the extension to make them more readily available and more performant.
## :hammer_and_wrench: Build
Use SConstruct to build. More instructions to come. For now building as only been tested on Linux (and Windows but with some modifications). I aim to make this plugin buildable on Linux, MacOS, and Windows.
```bash
scons
```
```
## :fast_forward: Quick start
**These are very simple instructions and barely covers all the possibilities but it shows my willingness to try and document things to help people who want to adopt this plugin**
If the build went well, the final result should be found in `demo/addons/godot_ultraleap_plugin`. Copy this folder over your `addons` folder in your project to add it to your project. Reload your project for it to take effect.
From there the most simple way to get hand data is to add an UltraleapHandTracking node and an UltraleapDeviceNode node:
* Add an UltraleapHandTracking node to your scene
* Add a script to it with the following content (I am planning to remove this requirement in the future):
```
@tool
extends UltraleapHandTracking
func _ready():
start()
```
* Add an UltraleapDeviceNode node to your scene
* Assign the UltraleapHandTracking node to the `tracker` field on your UltraleapDeviceNode
* Add a script on your UltraleapDeviceNode containing the following:
```
extends UltraleapDeviceNode
func _process(_delta):
var frame : UltraleapFrame = get_last_frame()
if frame != null and frame.is_right_hand_visible:
print(frame.right_hand.palm.position)
```
* Hit play, make sure your hand tracking camera is plugged in, flat on your desk, and show your right hand. It should print the palm position in the editor's output.