-
大小: 5.97MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-10-01
- 語(yǔ)言: C#
- 標(biāo)簽: c#??leapmotion??
資源簡(jiǎn)介
leapmotion的官方例程,由于官方提供的例程需要自己建立項(xiàng)目,并且建立項(xiàng)目的過(guò)程麻煩,大家可以參考一下我的建立項(xiàng)目的方式

代碼片段和文件信息
/******************************************************************************\
*?Copyright?(C)?2012-2016?Leap?Motion?Inc.?All?rights?reserved.???????????????*
*?Leap?Motion?proprietary?and?confidential.?Not?for?distribution.??????????????*
*?Use?subject?to?the?terms?of?the?Leap?Motion?SDK?Agreement?available?at???????*
*?https://developer.leapmotion.com/sdk_agreement?or?another?agreement?????????*
*?between?Leap?Motion?and?you?your?company?or?other?organization.?????????????*
\******************************************************************************/
using?System;
using?System.Threading;
using?Leap;
class?SampleListener
{
??public?void?OnInit(Controller?controller)
??{
????Console.WriteLine(“Initialized“);
??}
??public?void?OnConnect(object?sender?DeviceEventArgs?args)
??{
????Console.WriteLine(“Connected“);
??}
??public?void?OnDisconnect(object?sender?DeviceEventArgs?args)
??{
????Console.WriteLine(“Disconnected“);
??}
??public?void?Onframe(object?sender?frameEventArgs?args)
??{
????//?Get?the?most?recent?frame?and?report?some?basic?information
????frame?frame?=?args.frame;
????Console.WriteLine(
??????“frame?id:?{0}?timestamp:?{1}?hands:?{2}“
??????frame.Id?frame.Timestamp?frame.Hands.Count
????);
????foreach?(Hand?hand?in?frame.Hands)
????{
??????Console.WriteLine(“??Hand?id:?{0}?palm?position:?{1}?fingers:?{2}“
????????hand.Id?hand.PalmPosition?hand.Fingers.Count);
??????//?Get?the?hand‘s?normal?vector?and?direction
??????Vector?normal?=?hand.PalmNormal;
??????Vector?direction?=?hand.Direction;
??????//?Calculate?the?hand‘s?pitch?roll?and?yaw?angles
??????Console.WriteLine(
????????“??Hand?pitch:?{0}?degrees?roll:?{1}?degrees?yaw:?{2}?degrees“
????????direction.Pitch?*?180.0f?/?(float)Math.PI
????????normal.Roll?*?180.0f?/?(float)Math.PI
????????direction.Yaw?*?180.0f?/?(float)Math.PI
??????);
??????//?Get?the?Arm?bone
??????Arm?arm?=?hand.Arm;?//手臂
??????Console.WriteLine(
????????“??Arm?direction:?{0}?wrist?position:?{1}?elbow?position:?{2}“
????????arm.Direction?arm.WristPosition?arm.ElbowPosition
??????);
??????//?Get?fingers
??????foreach?(Finger?finger?in?hand.Fingers)
??????{
????????Console.WriteLine(
??????????“????Finger?id:?{0}?{1}?length:?{2}mm?width:?{3}mm“
??????????finger.Id
??????????finger.Type.ToString()
??????????finger.Length
??????????finger.Width
????????);
????????//?Get?finger?bones
????????Bone?bone;???//骨骼
????????for?(int?b?=?0;?b?4;?b++)
????????{
??????????bone?=?finger.Bone?((Bone.BoneType)b);
??????????Console.WriteLine?(
????????????“??????Bone:?{0}?start:?{1}?end:?{2}?direction:?{3}“
????????????bone.Type?bone.PrevJoint?bone.NextJoint?bone.Direction
??????????);
????????}
??????}
????}
????if?(frame.Hands.Count?!=?0)
????{
??????Console.WriteLine(““);
????}
??}
??public?void?OnServiceConnect(object?sender?ConnectionEventArgs?args)
??{
????Console.WriteLine
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
????..A..H.?????44544??2017-09-18?16:56??leadproject\.vs\Sample\v14\.suo
?????文件????????189??2017-09-09?16:48??leadproject\Sample\App.config
?????文件????2687448??2016-12-14?08:33??leadproject\Sample\bin\Debug\LeapC.dll
?????文件??????90584??2016-12-14?08:33??leadproject\Sample\bin\Debug\LeapCSharp.NET4.5.dll
?????文件???????9216??2017-09-12?11:12??leadproject\Sample\bin\Debug\Sample.exe
?????文件????????189??2017-09-09?16:48??leadproject\Sample\bin\Debug\Sample.exe.config
?????文件??????15872??2017-09-12?11:12??leadproject\Sample\bin\Debug\Sample.pdb
?????文件??????22696??2017-09-18?16:54??leadproject\Sample\bin\Debug\Sample.vshost.exe
?????文件????????189??2017-09-09?16:48??leadproject\Sample\bin\Debug\Sample.vshost.exe.config
?????文件????????490??2017-03-19?05:00??leadproject\Sample\bin\Debug\Sample.vshost.exe.manifest
?????文件?????179415??2016-06-14?03:48??leadproject\Sample\leap?sdk\include\Leap.h
?????文件??????41659??2016-06-14?03:48??leadproject\Sample\leap?sdk\include\Leap.i
?????文件??????38609??2016-06-14?03:48??leadproject\Sample\leap?sdk\include\LeapC.h
?????文件??????29541??2016-06-14?03:48??leadproject\Sample\leap?sdk\include\LeapMath.h
?????文件??????85324??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\Leap.py
?????文件??????90584??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\LeapCSharp.NET3.5.dll
?????文件??????90584??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\LeapCSharp.NET4.0.dll
?????文件??????90584??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\LeapCSharp.NET4.5.dll
?????文件??????84203??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\LeapJava.jar
?????文件??????90584??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\UnityAssets\Plugins\LeapCSharp.NET3.5.dll
?????文件????2687448??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\UnityAssets\Plugins\x86\LeapC.dll
?????文件????3121112??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\UnityAssets\Plugins\x86_64\LeapC.dll
?????文件????3867096??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\Leap.dll
?????文件?????128848??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\Leap.lib
?????文件????3121112??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\LeapC.dll
?????文件???????8502??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\LeapC.lib
?????文件?????206296??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\LeapJava.dll
?????文件?????441304??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\LeapPython.pyd
?????文件?????660128??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\msvcp120.dll
?????文件?????963232??2016-12-14?08:33??leadproject\Sample\leap?sdk\lib\x64\msvcr120.dll
............此處省略81個(gè)文件信息
- 上一篇:C#實(shí)現(xiàn)決策樹(shù)
- 下一篇:C#制作PDF文件
評(píng)論
共有 條評(píng)論