了解 Auki 网络和代币经济的基本原理
在 Auki 网络的支持下,获取自己的领域。
深入了解Auki网络白皮书的细节
在Uniswap DEX上交易$AUKI
在MEXC CEX上交易$AUKI
在Aerodrome DEX上交易$AUKI
实时跟踪 Auki 网络的网络状况。
See how the Auki network is empowering robot fleets.
See how the Auki network is enabling AI.
See how the Auki network is enabling XR experiences.
使用ConjureKit,构建第一代社交增强现实体验。
申请高达 100,000 美元 Auki 代币的开发者补助金
了解如何在 posemesh 上使用我们的 SDK 构建应用程序。
所有 ConjureKit SDK 文档和支援。
了解 Cactus 如何提高零售效率。
了解 Gotu 如何协助物业经理工作。
了解 Gotu 导航如何提升您的活动体验。
零售行业的空间人工智能平台。
为活动和物业提供室内导航。
家庭和展览装饰应用。
通过这个同时多人共享的AR体验,让您大获全胜。
看看谁在与Auki一起搭建 posemesh。
深入了解我们的理念。
加入 Discord 对话。
通过 X 随时了解 Auki 社区的最新动态。
Stay up to date with the Auki community on X.
关于 Auki 和 posemesh 的常见问题。
我们的新闻稿、媒体资料工具包和联系方式。
In this chapter we'll cover how to get started with using and visualizing Ur for hand tracking.
Install the Ur package and import it to ^ConjureKitManager^.
ConjureKitManager^
using Auki.Ur;
Also import ^ARFoundation^ to be able to use the ^ARRaycastManager^.
ARFoundation^
ARRaycastManager^
using UnityEngine.XR.ARFoundation;
Create a private ^HandTracker^ variable, as well as serializable ^ARSession^ and ^ARRaycastManager^ variables.
HandTracker^
ARSession
private HandTracker _handTracker; [SerializeField] private ARSession arSession; [SerializeField] private ARRaycastManager arRaycastManager;
Attach the ^ARRaycastManager^ component to AR Session Origin GameObject. Then drag the ^ARSession^ and the ^ARRaycastManager^ components to coressponding fields on the ^ConjureKitManager^ GameObject.
ARSession^
Get the ^HandTracker^ instance and initialize the AR system in ^ConjureKitManager^'s ^Start()^ function.
Start()^
_handTracker = HandTracker.GetInstance(); _handTracker.SetARSystem(arSession, arCamera, arRaycastManager);
Start the ^HandTracker^ by calling
_handTracker.Start();
Call ^_handTracker.Update()^ every frame to continuously track the hand while moving.
_handTracker.Update()^
private void Update() { _handTracker.Update(); }
Now we want to position a sphere with a collider on our hand's index fingertip so it can interact with the cube.
To begin, create a 3d sphere, rename it to FingertipLandmark, and scale it down to 0.3. On the collider component, tick the ^isTrigger^ checkbox.
isTrigger^
Create a new material, change its color to something more noticeable, and drag it to the sphere mesh renderer.
Add a new tag in Project Settings -> Tags and Layers named hand or any other name you choose and add this tag to the FingertipLandmark we just created.
hand
Create a ^Renderer^ variable for the FingertipLandmark.
Renderer^
[SerializeField] private Renderer Fingertip Landmark;
Populate it with the sphere we just created. And in Start function, set the fingertip landmark as a child of our camera transform.
fingertipLandmark.transform.SetParent(arCamera.transform);
To get triggers from other colliders, the cube should have a ^Rigidbody^ component. Add it and tick the ^Is Kinematic^ checkbox to make sure the cube doesn't fall.
Rigidbody^
Is Kinematic^
Create a new C# script called ^TouchableByHand.cs^ that will handle trigger events on the cube. If the cube is triggered with an object tagged with hand its color will change to a random color. If the trigger exits the cube, it will return to white.
public class TouchableByHand : MonoBehaviour { private void OnTriggerEnter(Collider other) { if (other.tag == "hand") { gameObject.GetComponent<Renderer>().material.color = Random.ColorHSV(); } } private void OnTriggerExit(Collider other) { if (other.tag == "hand") { gameObject.GetComponent<Renderer>().material.color = Color.white; } } }
Add this script to the cube prefab.
To get our landmark positions in real-time, we will use the Ur callback - ^OnUpdate^ that is invoked when a new hand pose is received. This callback will pass 4 data types:
The landmark and translation arrays contain consecutive floats representing the x, y & z-components of a 3D vector.
Once we get the landmarks and translations, we can place the fingertip landmark on landmark 8, the tip of the index finger (see the Ur documentation for a diagram of all hand landmarks). If the hand tracker detects a hand, we should see the fingertip landmark. If not, meaning our hand is not in camera sight, we can disable the fingertip landmark renderer.
_handTracker.OnUpdate += (landmarks, translations, isRightHand, score) => { if (score[0] > 0) { var handPosition = new Vector3( translations[0], translations[1], translations[2]); var pointerLandmarkIndex = 8 * 3; // Index fingertip var pointerLandMarkPosition = new Vector3( landmarks[pointerLandmarkIndex + 0], landmarks[pointerLandmarkIndex + 1], landmarks[pointerLandmarkIndex + 2]); fingertipLandmark.enabled = true; fingertipLandmark.transform.localPosition = handPosition + pointerLandMarkPosition; } else { fingertipLandmark.enabled = false; } };
The Ur package allows us to visualize the hand landmarks in two simple steps.
Start by creating a private boolean.
landmarksVisualizeBool = true;
Then create a toggle method that uses the hand tracker methods ^ShowHandMesh^ and ^HideHandMesh^.
ShowHandMesh^
HideHandMesh^
public void ToggleHandLandmarks() { landmarksVisualizeBool = !landmarksVisualizeBool; if (landmarksVisualizeBool) { _handTracker.ShowHandMesh(); } else { _handTracker.HideHandMesh(); } }
Now it can be toggled using a UI toggle or any other method you choose.
申请 AUKI 代币补助金以启动您的项目,并直接与 Auki Labs 团队合作,将您的创意推向市场。成功申请者可获得价值高达 10 万美元的 AUKI 代币,以及 Auki Labs 团队提供的开发和营销支持。