当前位置: 首页>>代码示例>>Java>>正文


Java Hand.palmNormal方法代码示例

本文整理汇总了Java中com.leapmotion.leap.Hand.palmNormal方法的典型用法代码示例。如果您正苦于以下问题:Java Hand.palmNormal方法的具体用法?Java Hand.palmNormal怎么用?Java Hand.palmNormal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.leapmotion.leap.Hand的用法示例。


在下文中一共展示了Hand.palmNormal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDetectionData

import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
public DetectionData getDetectionData(Hand hand)
{
  // Get the hand's normal vector and direction
  Vector normal = hand.palmNormal();
  Vector direction = hand.direction();

  float pitch = ((Double) Math.toDegrees(direction.pitch())).floatValue()
          / MAX_PITCH;
  float roll = ((Double) Math.toDegrees(normal.roll())).floatValue()
          / MAX_ROLL;
  float yaw = ((Double) Math.toDegrees(direction.yaw())).floatValue()
          / MAX_YAW;
  float height = hand.palmPosition().getY() / MAX_HEIGHT;

  return new DetectionData(roll, pitch, yaw, height);
}
 
开发者ID:theone1984,项目名称:parroteer,代码行数:17,代码来源:LeapMotionListener.java

示例2: HandShape

import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
/**
 * Constructs a hand shape from the Hand object
 * 
 * @param hand
 *            the hand to construct the hand shape from
 */
public HandShape(Hand hand) {
	if (hand.isLeft()) {
		this.data.handSide = LEFT;
	} else {
		this.data.handSide = RIGHT;
	}
	this.data.fingerPositions = new Vector[hand.fingers().count()];
	for (int i = 0; i < data.fingerPositions.length; i++) {
		data.fingerPositions[i] = hand.fingers().get(i).tipPosition();
	}
	this.data.palmLocation = hand.palmPosition();
	// this.data.handBasis = hand.basis();
	this.data.palmDirection = hand.palmNormal();
}
 
开发者ID:npw3202,项目名称:ASL-recognition,代码行数:21,代码来源:HandShape.java

示例3: mapLeapHandData

import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
private LeapMotion2.Hand mapLeapHandData(Hand lh) {
	LeapMotion2.Hand mrlHand = new LeapMotion2.Hand();
	// process the normal
	Vector palmNormal = lh.palmNormal();
	mrlHand.palmNormalX = palmNormal.getX();
	mrlHand.palmNormalY = palmNormal.getY();
	mrlHand.palmNormalZ = palmNormal.getZ();

	// handle the fingers.
	for (Finger.Type t : Finger.Type.values()) {
		Finger f = lh.fingers().get(t.ordinal());
		double angle = computeAngleDegrees(f, palmNormal);
		if (t.equals(Finger.Type.TYPE_INDEX))
			mrlHand.index = angle;
		else if (t.equals(Finger.Type.TYPE_MIDDLE))
			mrlHand.middle = angle;
		else if (t.equals(Finger.Type.TYPE_RING))
			mrlHand.ring = angle;
		else if (t.equals(Finger.Type.TYPE_PINKY))
			mrlHand.pinky = angle;
		else if (t.equals(Finger.Type.TYPE_THUMB))
			mrlHand.thumb = angle;
		else
			log.warn("Unknown finger! eek..");
	}
	return mrlHand;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:28,代码来源:LeapMotionListener.java

示例4: HandObj

import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
public HandObj(Hand h, FrameObj f, ControllerObj controller) {
	this.controller = controller;
	//fingerList = new FingerListObj(h.fingers());
	//pointableList = new PointableListObj(h.pointables());
	
	arm = new ArmObj(h.arm());
	
	confidence = h.confidence();
	direction = h.direction();
	//elbow
	frame = f;
	grabStrength = h.grabStrength();
	id = h.id();
	palmNormal = h.palmNormal();
	palmPosition = h.palmPosition();
	palmVelocity = h.palmVelocity();
	palmWidth = h.palmWidth();
	pinchStrength = h.pinchStrength();
	//r
	//s
	sphereCenter = h.sphereCenter();
	sphereRadius = h.sphereRadius();
	stabilizedPalmPosition = h.stabilizedPalmPosition();
	//t
	timeVisible = h.timeVisible();
	
	if (h.isLeft()) {
		type = "left";
	} else {
		type = "right";
	}
	
	wrist = h.wristPosition();
	
	
}
 
开发者ID:paluka,项目名称:Multi-Leap,代码行数:37,代码来源:HandObj.java

示例5: mapLeapHandData

import com.leapmotion.leap.Hand; //导入方法依赖的package包/类
private LeapHand mapLeapHandData(Hand lh) {
  LeapHand mrlHand = new LeapHand();
  // process the normal
  Vector palmNormal = lh.palmNormal();
  mrlHand.palmNormalX = palmNormal.getX();
  mrlHand.palmNormalY = palmNormal.getY();
  mrlHand.palmNormalZ = palmNormal.getZ();

  mrlHand.posX = lh.arm().center().getX();
  mrlHand.posY = lh.arm().center().getY();
  mrlHand.posZ = lh.arm().center().getZ();

  // handle the fingers.
  for (Finger.Type t : Finger.Type.values()) {
    Finger f = lh.fingers().get(t.ordinal());
    int angle = (int) computeAngleDegrees(f, palmNormal);
    if (t.equals(Finger.Type.TYPE_INDEX))
      mrlHand.index = angle;
    else if (t.equals(Finger.Type.TYPE_MIDDLE))
      mrlHand.middle = angle;
    else if (t.equals(Finger.Type.TYPE_RING))
      mrlHand.ring = angle;
    else if (t.equals(Finger.Type.TYPE_PINKY))
      mrlHand.pinky = angle;
    else if (t.equals(Finger.Type.TYPE_THUMB))
      mrlHand.thumb = angle;
    else
      log.warn("Unknown finger! eek..");
  }
  return mrlHand;
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:32,代码来源:LeapMotionListener.java


注:本文中的com.leapmotion.leap.Hand.palmNormal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。