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


Java Point3D.getY方法代码示例

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


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

示例1: GoogleTrendChartEvent

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * @param source
 * @param target
 * @param eventType
 * @param x
 * @param y
 * @param screenX
 * @param screenY
 * @param pickResult
 * @param clickCount
 * @param contents
 */
public GoogleTrendChartEvent(Object source, EventTarget target, EventType<? extends GoogleTrendChartEvent> eventType, double x,
		double y, double screenX, double screenY, PickResult pickResult, int clickCount, List<Node> contents) {
	super(source, target, eventType);
	this.x = x;
	this.y = y;
	this.screenX = screenX;
	this.screenY = screenY;
	this.sceneX = x;
	this.sceneY = y;
	this.pickResult = pickResult != null ? pickResult : new PickResult(target, x, y);
	final Point3D p = InputEventUtils.recomputeCoordinates(this.pickResult, null);
	this.x = p.getX();
	this.y = p.getY();
	this.z = p.getZ();
	this.clickCount = clickCount;
	this.contents = contents;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:30,代码来源:GoogleTrendChartEvent.java

示例2: DockEvent

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Constructs new DockEvent event..
 * 
 * @param source the source of the event. Can be null.
 * @param target the target of the event. Can be null.
 * @param eventType The type of the event.
 * @param x The x with respect to the source. Should be in scene coordinates if source == null or
 *        source is not a Node.
 * @param y The y with respect to the source. Should be in scene coordinates if source == null or
 *        source is not a Node.
 * @param screenX The x coordinate relative to screen.
 * @param screenY The y coordinate relative to screen.
 * @param pickResult pick result. Can be null, in this case a 2D pick result without any further
 *        values is constructed based on the scene coordinates
 * @param contents The contents being dragged during this event.
 */
public DockEvent(Object source, EventTarget target, EventType<? extends DockEvent> eventType,
    double x, double y, double screenX, double screenY, PickResult pickResult, Node contents) {
  super(source, target, eventType);
  this.x = x;
  this.y = y;
  this.screenX = screenX;
  this.screenY = screenY;
  this.sceneX = x;
  this.sceneY = y;
  this.pickResult = pickResult != null ? pickResult : new PickResult(target, x, y);
  final Point3D p = InputEventUtils.recomputeCoordinates(this.pickResult, null);
  this.x = p.getX();
  this.y = p.getY();
  this.z = p.getZ();
  this.contents = contents;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:33,代码来源:DockEvent.java

示例3: moveCamera

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Moves the camera
 * @since v0.2
 *
 * @param position the new camera position
 * @param rotation the new camera rotation
 * @param transitionTime the transition length to new camera position and rotation
 */
public void moveCamera(Point3D position, double rotation, int transitionTime)
{
    if (getTranslateX() != position.getX() || getTranslateY() != position.getY() || getTranslateZ() != position.getZ() || rotation != getRotate())
    {
        if (transitionTime < 1)
        {
            transitionTime = 1;
        }
        Timeline timeline = new Timeline();
        timeline.getKeyFrames().addAll(
                new KeyFrame(new Duration(transitionTime), new KeyValue(translateXProperty(), position.getX())),
                new KeyFrame(new Duration(transitionTime), new KeyValue(translateYProperty(), position.getY())),
                new KeyFrame(new Duration(transitionTime), new KeyValue(translateZProperty(), position.getZ())),
                new KeyFrame(new Duration(transitionTime), new KeyValue(rotateProperty(), rotation))
        );
        timeline.play();
    }
}
 
开发者ID:Bokoblin,项目名称:DUTS3-CPOA-ProjetTarot,代码行数:27,代码来源:ViewCamera.java

示例4: calculateZValueInTriangle

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Calculates the z value of an given 3d triangle and a 2d point, where x and y coordinates are in this triangle
 * http://math.stackexchange.com/a/851752
 */
public static double calculateZValueInTriangle(Point2D p, Point3D p0, Point3D p1, Point3D p2) {
    double divider = ((p1.getX() - p0.getX()) * (p2.getY() - p0.getY())) - ((p2.getX() - p0.getX()) * (p1.getY() - p0.getY()));
    double z = p0.getZ() + (((((p1.getX() - p0.getX()) * (p2.getZ() - p0.getZ())) - ((p2.getX() - p0.getX()) * (p1.getZ() - p0.getZ()))) / divider) * (p.getY() - p0.getY()))
            - (((((p1.getY() - p0.getY()) * (p2.getZ() - p0.getZ())) - ((p2.getY() - p0.getY()) * (p1.getZ() - p0.getZ()))) / divider) * (p.getX() - p0.getX()));
    return z;
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:11,代码来源:MeshImageBuilder.java

示例5: calculateYValueInTriangle

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Calculates the y value of an given 3d triangle and a 2d point, where x and z coordinates are in this triangle
 */
public static double calculateYValueInTriangle(Point2D p, Point3D p0, Point3D p1, Point3D p2) {
    double divider = ((p1.getZ() - p0.getZ()) * (p2.getX() - p0.getX())) - ((p1.getX() - p0.getX()) * (p2.getZ() - p0.getZ()));
    double y = p0.getY() + (((((p1.getY() - p0.getY()) * (p2.getX() - p0.getX())) - ((p1.getX() - p0.getX()) * (p2.getY() - p0.getY()))) / divider) * (p.getY() - p0.getZ()))
            - (((((p1.getY() - p0.getY()) * (p2.getZ() - p0.getZ())) - ((p2.getY() - p0.getY()) * (p1.getZ() - p0.getZ()))) / divider) * (p.getX() - p0.getX()));
    return y;
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:10,代码来源:MeshImageBuilder.java

示例6: MeshCalculationComposite

import javafx.geometry.Point3D; //导入方法依赖的package包/类
private MeshCalculationComposite(List<Point3D> dataPoints, int size) {
    this.dataPoints = dataPoints;
    this.size = size;

    for (Point3D point3d : dataPoints) {
        minX = Math.min(minX, point3d.getX());
        maxX = Math.max(maxX, point3d.getX());
        minY = Math.min(minY, point3d.getY());
        maxY = Math.max(maxY, point3d.getY());
        minZ = Math.min(minZ, point3d.getZ());
        maxZ = Math.max(maxZ, point3d.getZ());
    }
    sizeX = maxX - minX;
    sizeY = maxY - minY;
    sizeZ = maxZ - minZ;

    // normalize points according to coordinate system size
    normalizedPoints = new ArrayList<Point3D>(dataPoints.size());
    for (Point3D point : dataPoints) {
        double x = (point.getX() - minX) / sizeX * size;
        double y = (point.getY() - minY) / sizeY * size;
        double z = (point.getZ() - minZ) / sizeZ * size;
        normalizedPoints.add(new Point3D(x, y, z));
    }

    triangle3DList = new ArrayList<Triangle3D>(dataPoints.size() / 2);
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:28,代码来源:MeshCalculationComposite.java

示例7: apply

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Apply this rotation matrix to the given point.
 *
 * @param p Point
 * @return Rotated point
 */
public Point3D apply(Point3D p) {
  final double x = p.getX();
  final double y = p.getY();
  final double z = p.getZ();
  return new Point3D(x * m[0][0] + y * m[0][1] + z * m[0][2],
                     x * m[1][0] + y * m[1][1] + z * m[1][2],
                     x * m[2][0] + y * m[2][1] + z * m[2][2]);
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:15,代码来源:RotMatrix.java

示例8: convertPoint3d4Delauney

import javafx.geometry.Point3D; //导入方法依赖的package包/类
@Override
public Point convertPoint3d4Delauney(Point3D point) {
    return new Point(point.getX(), point.getZ(), point.getY());
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:5,代码来源:StarterFrame.java

示例9: convertPoint3d4Delauney

import javafx.geometry.Point3D; //导入方法依赖的package包/类
@Override
public Point convertPoint3d4Delauney(Point3D point) {
    return new Point(point.getX(), point.getY(), point.getZ());
}
 
开发者ID:adihubba,项目名称:javafx-3d-surface-chart,代码行数:5,代码来源:DefaultDelauneyModifier.java

示例10: getPickedRotation

import javafx.geometry.Point3D; //导入方法依赖的package包/类
public static String getPickedRotation(int cubie, MeshView mesh){
    Point3D normal = getMeshNormal(mesh);
    String rots = ""; // Rx-Ry 
    switch(cubie){
        case 0: rots = (normal.getZ() > 0.99) ? "Ui-Li" : ((normal.getX() < -0.99) ? "Ui-F" : ((normal.getY() > 0.99) ? "Ui-Li" : ""));
                break;
        case 1: rots = (normal.getZ() > 0.99) ? "F-Mi" : ((normal.getY() > 0.99) ? "Ui-Mi" : ""); // between L and R, as L
                break;
        case 2:  rots = (normal.getZ() > 0.99) ? "Ui-R" : ((normal.getX() > 0.99) ? "Ui-Fi" : ((normal.getY() > 0.99) ? "Ui-R" : ""));
                break;
        case 3: rots = (normal.getZ() > 0.99) ? "E-F" : ((normal.getX() < -0.99) ? "E-Li" : ""); // between U and D, as D
                break;
        case 4:  rots = (normal.getZ() > 0.99) ? "Yi-X" : ""; 
                break;
        case 5: rots = (normal.getZ() > 0.99) ? "E-Fi" : ((normal.getX() > 0.99) ? "E-R" : ""); // between U and D, as D
                break;
        case 6: rots = (normal.getZ() > 0.99) ? "D-Li" : ((normal.getX() < -0.99) ? "D-F" : ((normal.getY() < -0.99) ? "D-Li" : ""));
                break;
        case 7: rots = (normal.getZ() > 0.99) ? "Fi-Mi" : ((normal.getY() < -0.99) ? "Fi-Mi" : ""); // between L and R, as L
                break;
        case 8: rots = (normal.getZ() > 0.99) ? "D-R" : ((normal.getX() > 0.99) ? "D-Fi" : ((normal.getY() < -0.99) ? "D-R" : ""));
                break;
        
        case 9: rots = (normal.getY() > 0.99) ? "S-U" : ((normal.getX() < -0.99) ? "L-S" : ""); // between U and D, as D
                break;
        case 10: rots = (normal.getY() > 0.99) ? "Z-X" : ""; 
                break;
        case 11: rots = (normal.getY() > 0.99) ? "S-Ui" : ((normal.getX() > 0.99) ? "R-Si" : ""); // between U and D, as D
                break;
        case 12: rots = (normal.getX() < -0.99) ? "Yi-Z" : ""; 
                break;
        case 14: rots = (normal.getX() > 0.99) ? "Yi-Zi" : ""; 
                break;
        case 15: rots = (normal.getY() < -0.99) ? "D-S" : ((normal.getX() < -0.99) ? "Li-S" : ""); // between U and D, as D
                break;
        case 16: rots = (normal.getY() < -0.99) ? "Zi-X" : ""; 
                break;
        case 17: rots = (normal.getY() < -0.99) ? "D-S" : ((normal.getX() > 0.99) ? "Ri-Si" : ""); // between U and D, as D
                break;
        
        case 18: rots = (normal.getZ() < -0.99) ? "Ui-L" : ((normal.getX() < -0.99) ? "Ui-Bi" : ((normal.getY() > 0.99) ? "Ui-L" : ""));
                break;
        case 19: rots = (normal.getZ() < -0.99) ? "B-M" : ((normal.getY() > 0.99) ? "U-M" : ""); // between L and R, as L
                break;
        case 20: rots = (normal.getZ() < -0.99) ? "Ui-Ri" : ((normal.getX() > 0.99) ? "Ui-B" : ((normal.getY() > 0.99) ? "Ui-Ri" : ""));
                break;
        case 21: rots = (normal.getZ() < -0.99) ? "E-Bi" : ((normal.getX() < -0.99) ? "E-L" : ""); // between U and D, as D
                break;
        case 22: rots = (normal.getZ() < -0.99) ? "Yi-Xi" : ""; 
                break;
        case 23: rots = (normal.getZ() < -0.99) ? "E-B" : ((normal.getX() > 0.99) ? "E-Ri" : ""); // between U and D, as D
                break;
        case 24: rots = (normal.getZ() < -0.99) ? "D-L" : ((normal.getX() < -0.99) ? "D-Bi" : ((normal.getY() < -0.99) ? "D-L" : ""));
                break;
        case 25: rots = (normal.getZ() < -0.99) ? "Bi-M" : ((normal.getY() < -0.99) ? "Bi-M" : ""); // between L and R, as L
                break;
        case 26: rots = (normal.getZ() < -0.99) ? "D-Ri" : ((normal.getX() > 0.99) ? "D-B" : ((normal.getY() < -0.99) ? "D-B" : ""));
                break;
        
    }
    return rots;
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:63,代码来源:Utils.java

示例11: LineTriangleMesh

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * The default constructor which sets up the mesh to display a line.
 * 
 * @param start
 *            The line's start point.
 * @param end
 *            The line's end point.
 */
public LineTriangleMesh(Point3D start, Point3D end) {
	super();

	// Get the angle between the two points
	Point3D perp = start.crossProduct(end);

	// Remove the y component from the vector and normalize it to length 1.
	perp.add(0, -1 * perp.getY(), 0);
	perp = perp.normalize();

	// Get the start point's coordinates
	float startX = (float) start.getX();
	float startY = (float) start.getY();
	float startZ = (float) start.getZ();

	// Get the end point's coordinates
	float endX = (float) end.getX();
	float endY = (float) end.getY();
	float endZ = (float) end.getZ();

	// Get the perpendicular vector's x and y amounts
	float perpX = (float) perp.getX();
	float perpZ = (float) perp.getZ();

	// If the line would have no width, instead set it to draw along the x
	// axis.
	if (perpX == 0 && perpZ == 0) {
		perpX = 1;
	}

	// Set the points array. The array will form a rectangle centered along
	// the line, with the perpendicular vector providing the x and z
	// direction offsets to give the rectangle its width.
	getPoints().addAll(new float[] { startX - perpX, startY, startZ - perpZ,
			startX + perpX, startY, startZ + perpZ, endX - perpX, endY,
			endZ - perpZ, endX + perpX, endY, endZ + perpZ });

	// There will be no texture on the line, so add a dummy coordinate
	// instead.
	getTexCoords().addAll(new float[] { 0, 0 });

	// Create faces for the line. There will be two triangles, which
	// together will form a rectangle. Each triangle will be drawn twice,
	// facing opposite directions each time, to ensure that the line is
	// displayed in the proper color from both directions.
	getFaces().addAll(new int[] { 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 2, 0, 1, 0,
			2, 0, 3, 0, 2, 0, 1, 0, 3, 0 });
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:57,代码来源:LineTriangleMesh.java

示例12: addDataFromNode

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Extracts svg properties directly from the given Node and applies them.
 *
 * @param nodeProperties
 * @param node
 */
protected void addDataFromNode(Node node) {

	svgNodeProperties = new SvgNodeProperties();

	//comment
	String className = node.getClass().getName();
	svgNodeProperties.addComment(className);

	String comment = createCssClassString(node);
	svgNodeProperties.addComment(comment);

	//id
	String id = node.getId();
	svgNodeProperties.setId(id);

	//visibility
	if (node.isVisible()) {
		svgNodeProperties.setVisibility(SvgVisibility.VISIBLE);
	} else {
		svgNodeProperties.setVisibility(SvgVisibility.HIDDEN);
	}

	//opacity
	Double opacity = node.getOpacity();
	svgNodeProperties.setOpacity(opacity);

	Bounds bounds = node.getBoundsInParent();

	//x
	Double x = bounds.getMinX();
	svgNodeProperties.setX(x);

	//y
	Double y = bounds.getMinY();
	svgNodeProperties.setY(y);

	//x scale
	Double xScale = node.getScaleX();
	svgNodeProperties.setXScale(xScale);

	//y scale
	Double yScale = node.getScaleY();
	svgNodeProperties.setYScale(yScale);

	//rotation
	Double rotation = node.getRotate();
	svgNodeProperties.setRotation(rotation);

	//rotation axis
	Point3D rotationAxis = node.getRotationAxis();

	Double rotationAxisX = rotationAxis.getX();
	svgNodeProperties.setRotationAxisX(rotationAxisX);

	Double rotationAxisY = rotationAxis.getY();
	svgNodeProperties.setRotationAxisY(rotationAxisY);

}
 
开发者ID:stefaneidelloth,项目名称:JavaFxNodeToSvg,代码行数:65,代码来源:AbstractNodeToSvgConverter.java

示例13: lookAt

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * <p>
 * Computes a matrix to orient a node towards a given point, defined by
 * target.
 * </p>
 * 
 * @param target
 *            the target to look at
 * @param pos
 *            the viewer's current location
 * @param yUp
 *            the direction of "up"
 * 
 * @return affine transform that orients towards the target
 */
public static Affine lookAt(Point3D target, Point3D pos, Point3D yUp) {
    Point3D z = target.subtract(pos).normalize();
    Point3D x = yUp.normalize().crossProduct(z).normalize();
    Point3D y = z.crossProduct(x).normalize();

    return new Affine(x.getX(), y.getX(), z.getX(), pos.getX(), x.getY(), y.getY(), z.getY(), pos.getY(), x.getZ(),
            y.getZ(), z.getZ(), pos.getZ());
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:24,代码来源:CamUtil.java

示例14: distance

import javafx.geometry.Point3D; //导入方法依赖的package包/类
/**
 * Calculate the straight line distance between the two given points. Each
 * point is radius, z, angle (degrees) in lathe coordinates
 *
 * @param p1
 * @param p2
 * @return straight line distance
 */
private double distance(Point3D p1, Point3D p2) {
  Point3D p1x = new Point3D(p1.getX() * Math.sin(Math.toRadians(p1.getZ())), p1.getX() * Math.cos(Math.toRadians(p1.getZ())), p1.getY());
  Point3D p2x = new Point3D(p2.getX() * Math.sin(Math.toRadians(p2.getZ())), p2.getX() * Math.cos(Math.toRadians(p2.getZ())), p2.getY());
  return Math.abs(p1x.distance(p2x));
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:14,代码来源:SpiralLine.java


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