Package javafx.geometry

Examples of javafx.geometry.Point3D


    @Override
    public void stepSimulation() {
        if(state==BombState.ACTIVE){
            bombPhysicalObject.stepSimulation();
            Quat4d q = bombPhysicalObject.getOrientation();
            rotate.setAxis(new Point3D(q.x, q.y, q.z));
            double radians = Math.acos(q.w) * 2;
            rotate.setAngle(Math.toDegrees(radians));

            Vector3d place = bombPhysicalObject.getPlace();
            setTranslateX(place.getX());
View Full Code Here


        setTranslateY(place.getY());
       
        Quat4d q = planePhysicalObject.getOrientation();           
        double radians = Math.acos(q.w) * 2;
        if(!Double.isNaN(radians)){
            rotate.setAxis(new Point3D(q.x, q.y, q.z));          
            rotate.setAngle(Math.toDegrees(radians));
        }       
    }
View Full Code Here

      double ly = uy + h + reflectionSpace;

      double cos = Math.cos(angleOnCarousel);
      double sin = -Math.sin(angleOnCarousel);

      ul = new Point3D((carouselRadius + halfCellWidth) * cos, uy, (carouselRadius + halfCellWidth) * sin);
      ur = new Point3D((carouselRadius - halfCellWidth) * cos, uy, (carouselRadius - halfCellWidth) * sin);
      ll = new Point3D((carouselRadius + halfCellWidth) * cos, ly, (carouselRadius + halfCellWidth) * sin);
      lr = new Point3D((carouselRadius - halfCellWidth) * cos, ly, (carouselRadius - halfCellWidth) * sin);

      if(reflection != null) {
        ulReflection = new Point3D((carouselRadius + halfCellWidth) * cos, uy + h + reflectionTop, (carouselRadius + halfCellWidth) * sin);
        urReflection = new Point3D((carouselRadius - halfCellWidth) * cos, uy + h + reflectionTop, (carouselRadius - halfCellWidth) * sin);
      }

    //Equivalent code:
//    Point3D ul = new Point3D(carouselRadius / scaleFactor + w / 2, -h / 2, 0);
//    Point3D ur = new Point3D(carouselRadius / scaleFactor - w / 2, -h / 2, 0);
View Full Code Here

     */
    public void applyViewRotation() {
      if(index < 3) {
        double angle = index > -3 ? Math.PI / 2 * -index / 3 + Math.PI / 2 : Math.PI;

        Point3D axis = new Point3D((ul.getX() + ur.getX()) / 2, 0, (ul.getZ() + ur.getZ()) / 2);

        ul = rotateY(ul, axis, angle);
        ur = rotateY(ur, axis, angle);
        ll = rotateY(ll, axis, angle);
        lr = rotateY(lr, axis, angle);
View Full Code Here

  private static Point2D project(Point3D p, double viewDistance, double fov, double cw, double ch) {
    return new Point2D(p.getX() * fov / (p.getZ() + viewDistance) + cw, p.getY() * fov / (p.getZ() + viewDistance) + ch);
  }

  private static Point3D rotateY(Point3D p, Point3D axis, double radians) {
    Point3D input = new Point3D(p.getX() - axis.getX(), p.getY() - axis.getY(), p.getZ() - axis.getZ());

    return new Point3D(
      input.getZ() * Math.sin(radians) + input.getX() * Math.cos(radians) + axis.getX(),
      input.getY() + axis.getY(),
      input.getZ() * Math.cos(radians) - input.getX() * Math.sin(radians) + axis.getZ()
    );
  }
View Full Code Here

TOP

Related Classes of javafx.geometry.Point3D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.