/** * Returns the center point on a line. */ public static Point3d findCenter(Point3d min, Point3d max) { Point3d center = new Point3d(); center.x = (min.x + max.x) / 2.0; center.y = (min.y + max.y) / 2.0; center.z = (min.z + max.z) / 2.0; return center; }
light1.setInfluencingBounds(new BoundingSphere(new Point3d(-5.0,0,0),10.0)); light1.setColor(new Color3f(1f,1f,1f)); light1.setDirection(new Vector3f(0,1,0)); objRotate.addChild(light1); DirectionalLight light2=new DirectionalLight(); light2.setInfluencingBounds(new BoundingSphere(new Point3d(5.0,0,0),10.0)); light2.setColor(new Color3f(0.5f,1f,0.5f)); light2.setDirection(new Vector3f(0,-1,0));
objRotate.addChild(sh); DirectionalLight light1=new DirectionalLight(); light1.setInfluencingBounds(new BoundingSphere(new Point3d(-5.0,0,0),10.0)); light1.setColor(new Color3f(1f,1f,1f)); light1.setDirection(new Vector3f(0,1,0)); objRotate.addChild(light1); DirectionalLight light2=new DirectionalLight(); light2.setInfluencingBounds(new BoundingSphere(new Point3d(5.0,0,0),10.0)); light2.setColor(new Color3f(0.5f,1f,0.5f)); light2.setDirection(new Vector3f(0,-1,0));
/** * Constructor. */ public VisualizerCanvas() { this.addGLEventListener(this); this.addKeyListener(this); this.addMouseMotionListener(this); this.addMouseWheelListener(this); this.eye = new Point3d(0, 0, 1.5); this.center = new Point3d(0, 0, 0); this.workCoord = new Point3d(0, 0, 0); this.machineCoord = new Point3d(0, 0, 0); this.rotation = new Point3d(0.0, -30.0, 0.0); if (ortho) { setVerticalTranslationVector(); setHorizontalTranslationVector(); } }
public Cylinder3d(double height, double radius) { this.height = height; this.radius = radius; temporaryPoint = new Point3d(); }
public Point3d getPointCopy() { Point3d pointToReturn = new Point3d(); this.getPoint(pointToReturn); return pointToReturn; }
public Box3d(Point3d position, Quat4d orientation, double length, double width, double height) { setPose(position, orientation); dimensions = new EnumMap<Direction, Double>(Direction.class); faces = new EnumMap<FaceName, Plane3d>(FaceName.class); temporaryPoint = new Point3d(); temporaryMatrix = new Matrix3d(); commonConstructor(length, width, height); }
public static Point3d readPoint3d(final String tagName, final Element parentEl) { final Element ptEl = parentEl.getChild(tagName); if (ptEl == null) { return null; } else { final double x = getDoubleVal(ptEl, JDOMUtils.tagX); final double y = getDoubleVal(ptEl, JDOMUtils.tagY); final double z = getDoubleVal(ptEl, JDOMUtils.tagZ); return new Point3d(x, y, z); } }
public static Point3d readPoint3d(final Element ptEl) { if (ptEl == null) { return null; } else { final double x = getDoubleVal(ptEl, JDOMUtils.tagX); final double y = getDoubleVal(ptEl, JDOMUtils.tagY); final double z = getDoubleVal(ptEl, JDOMUtils.tagZ); return new Point3d(x, y, z); } }
public static Point3d generateRandomPointWithEdgeCases(Random random, double probabilityForEdgeCase) { double x = generateRandomDouble(random, probabilityForEdgeCase); double y = generateRandomDouble(random, probabilityForEdgeCase); double z = generateRandomDouble(random, probabilityForEdgeCase); return new Point3d(x, y, z); }
public static FramePose setupStanceFoot(SideDependentList<PoseReferenceFrame> soleFrames, SideDependentList<SixDoFJoint> sixDoFJoints) { FramePose startStanceFootPose = new FramePose(worldFrame, new Point3d(0.0, 0.2, 0.0), new Quat4d()); soleFrames.get(RobotSide.LEFT).setPoseAndUpdate(startStanceFootPose); soleFrames.get(RobotSide.LEFT).update(); Point3d stanceAnklePosition = new Point3d(); startStanceFootPose.getPosition(stanceAnklePosition); sixDoFJoints.get(RobotSide.LEFT).setPosition(stanceAnklePosition); return startStanceFootPose; }
private Point3d[] getCoordinateList(IAtomContainer atomContainer) { Point3d[] tmp = new Point3d[atomContainer.getAtomCount()]; for (int i = 0; i < atomContainer.getAtomCount(); i++) { IAtom atom = atomContainer.getAtom(i); if (atom.getPoint3d() == null) throw new IllegalArgumentException("Molecule must have 3D coordinates"); tmp[i] = new Point3d(atom.getPoint3d()); } return tmp; }
@Override public void getCellAverageStoredPoints(Collection<Point3d> points) { List<RecursableHyperTreeNode<GroundAirDescriptor, GroundOnlyQuadTreeData>> leaves =listAllLeafNodes(); for(RecursableHyperTreeNode<GroundAirDescriptor, GroundOnlyQuadTreeData> leaf :leaves) { HyperCubeLeaf<GroundAirDescriptor> leafData = leaf.getLeaf(); if(leafData!=null) points.add(new Point3d(leafData.getLocation()[0], leafData.getLocation()[1], leafData.getValue().getHeight())); } }
public Point3d getCameraPosition() { Vector3f position = new Vector3f(getLocation()); JMEGeometryUtils.transformFromJMECoordinatesToZup(position); return new Point3d(position.getX(), position.getY(), position.getZ()); }
public void getIntersectionWithLine(FramePoint pointToPack, FrameLine line) { checkReferenceFrameMatch(line.getReferenceFrame()); checkReferenceFrameMatch(pointToPack.getReferenceFrame()); Point3d intersectionToPack = new Point3d(); plane3d.getIntersectionWithLine(intersectionToPack, line.getPoint(), line.getNormalizedVector()); pointToPack.set(intersectionToPack); }
public static us.ihmc.humanoidRobotics.communication.packets.walking.FootstepDataMessage convertFootStepData(FootstepDataRosMessage msg) { RobotSide robotSide = RobotSide.values[(int) msg.getRobotSide()]; Vector3 loc = msg.getLocation(); Quaternion quat = msg.getOrientation(); Point3d location = new Point3d(loc.getX(), loc.getY(), loc.getZ()); Quat4d orientation = new Quat4d(quat.getX(), quat.getY(), quat.getZ(), quat.getW()); return new us.ihmc.humanoidRobotics.communication.packets.walking.FootstepDataMessage(robotSide, location, orientation); }