西安做网站找哪家公司好,dns可以将网站域名解析,吴中区做网站,自己制作手机软件app文章目录 1.下载 zSpace 开发环境1.1 zCore Unity Package1.2 zView Unity Package 2. 导入工程3. 发布设置4.功能实现4.1 用触控笔来实现对模型的拖拽#xff1a; 5. 后续更新 1.下载 zSpace 开发环境
官网地址
1.1 zCore Unity Package
zSpace 开发核心必须
1.2 zView … 文章目录 1.下载 zSpace 开发环境1.1 zCore Unity Package1.2 zView Unity Package 2. 导入工程3. 发布设置4.功能实现4.1 用触控笔来实现对模型的拖拽 5. 后续更新 1.下载 zSpace 开发环境
官网地址
1.1 zCore Unity Package
zSpace 开发核心必须
1.2 zView Unity Package
主要用途在zSpace设备外接显示屏或投影时将zSpace设备的3D画面转为2D画面进行展示zSpace显示3D外接设备显示2D按需下载
2. 导入工程
将下载好的 zCore Unity Package 导入到 Unity
3. 发布设置
Edit—ProjectSettings—Player—OtherSetting—Rendering—ColorSpace 改为 GammaEdit—ProjectSettings—Player—OtherSetting—AutoGraphicsAPIforWindows 取消勾选Edit—ProjectSettings—Player—OtherSetting—GraphicsAPIsforWindows-添加OpenGLCore其他全部删除 Edit—ProjectSettings—Player—XRSetting 中勾选 Virtual Reality SupportedEdit—ProjectSettings—Player—XRSetting—Virtual Reality SDKs 删除其他项添加 Stereo Display (non head-mounted)
4.功能实现
4.1 用触控笔来实现对模型的拖拽 //
// Copyright (C) 2007-2020 zSpace, Inc. All Rights Reserved.
//
using UnityEngine;
using UnityEngine.EventSystems;using zSpace.Core.EventSystems;
using zSpace.Core.Input;namespace zSpace.Core.Samples
{public class Draggable :ZPointerInteractable, IBeginDragHandler, IDragHandler, IEndDragHandler{// Public Methodspublic override ZPointer.DragPolicy GetDragPolicy(ZPointer pointer){if (pointer is ZMouse){return ZPointer.DragPolicy.LockToScreenAlignedPlane;}if (pointer is ZStylus){return ZPointer.DragPolicy.LockHitPosition;}return base.GetDragPolicy(pointer);}public void OnBeginDrag(PointerEventData eventData){ZPointerEventData pointerEventData eventData as ZPointerEventData;if (pointerEventData null ||pointerEventData.button ! PointerEventData.InputButton.Left){return;}Pose pose pointerEventData.Pointer.EndPointWorldPose;// Cache the initial grab state.this._initialGrabOffset Quaternion.Inverse(this.transform.rotation) *(this.transform.position - pose.position);this._initialGrabRotation Quaternion.Inverse(pose.rotation) *this.transform.rotation;// If the grabbable object has a rigidbody component,// mark it as kinematic during the grab.var rigidbody this.GetComponentRigidbody();if (rigidbody ! null){this._isKinematic rigidbody.isKinematic;rigidbody.isKinematic true;}// Capture pointer events.pointerEventData.Pointer.CapturePointer(this.gameObject);}public void OnDrag(PointerEventData eventData){ZPointerEventData pointerEventData eventData as ZPointerEventData;if (pointerEventData null ||pointerEventData.button ! PointerEventData.InputButton.Left){return;}Pose pose pointerEventData.Pointer.EndPointWorldPose;// Update the grab objects rotation.this.transform.rotation pose.rotation * this._initialGrabRotation;// Update the grab objects position.this.transform.position pose.position (this.transform.rotation * this._initialGrabOffset);}public void OnEndDrag(PointerEventData eventData){ZPointerEventData pointerEventData eventData as ZPointerEventData;if (pointerEventData null ||pointerEventData.button ! PointerEventData.InputButton.Left){return;}// Release the pointer.pointerEventData.Pointer.CapturePointer(null);// If the grabbable object has a rigidbody component,// restore its original isKinematic state.var rigidbody this.GetComponentRigidbody();if (rigidbody ! null){rigidbody.isKinematic this._isKinematic;}}// Private Membersprivate Vector3 _initialGrabOffset Vector3.zero;private Quaternion _initialGrabRotation Quaternion.identity;private bool _isKinematic false;}
}
5. 后续更新