mardi 2 juin 2015
JavaFX Image View Würfel berechnen
Posted on 03:20 by verona
Hallo
ich habe ein problem ich habe diese zwei Klassen hier gemacht
und
so ausgeführt
dabei Rausgekommen ist:
ich habe ein problem ich habe diese zwei Klassen hier gemacht
Java Code:
-
-
import javafx.scene.Group;
-
-
-
-
private static Wall w1;
-
private static Wall w2;
-
private static Wall w3;
-
private static Wall w4;
-
private static Wall w5;
-
private static Wall w6;
-
-
-
-
w1 = new Wall(Input,name);
-
w1.addToGroup(QuickSpiel.wo, name);
-
w1.setPos(name, x + w1.getWidth(name)/2, y, z);
-
w1.setRotation(name, 0, 90, 0);
-
-
w2 = new Wall(Input, name2);
-
w1.addToGroup(QuickSpiel.wo, name2);
-
w2.setPos(name2, x, y, z + w2.getDepth(name2)/2);
-
-
w3 = new Wall(Input,name3);
-
w1.addToGroup(QuickSpiel.wo, name3);
-
w3.setPos(name3, x, y + w3.getHeight(name3)/2, z);
-
w3.setRotation(name3, 90, 0, 0);
-
-
w4 = new Wall(Input,name4);
-
w1.addToGroup(QuickSpiel.wo, name4);
-
w4.setPos(name4, x, y - w4.getHeight(name4)/2, z);
-
w4.setRotation(name4, 90, 0, 0);
-
-
w5 = new Wall(Input,name5);
-
w1.addToGroup(QuickSpiel.wo, name5);
-
w5.setPos(name5, x - w5.getWidth(name5)/2, y, z);
-
w5.setRotation(name5, 0, 90, 0);
-
-
w6 = new Wall(Input, name6);
-
w1.addToGroup(QuickSpiel.wo, name6);
-
w6.setPos(name6, x, y, z - w2.getDepth(name6)/2);
-
-
-
-
}
-
}
und
Java Code:
-
-
package Spiele.MrTroble;
-
-
-
import java.util.ArrayList;
-
-
-
import javafx.geometry.Point3D;
-
import javafx.scene.Group;
-
import javafx.scene.Node;
-
import javafx.scene.image.Image;
-
import javafx.scene.image.ImageView;
-
import javafx.scene.transform.Rotate;
-
-
-
-
private static final ArrayList<ImageView[]> list = new ArrayList<ImageView[]>();
-
private static final ArrayList<double[]> koord = new ArrayList<double[]>();
-
-
-
this(ip, src, true);
-
}
-
-
this(ip,sourc,0,0,0,vis);
-
}
-
-
this(ip,sourc,x,y,z,0,0,0,vis);
-
}
-
-
vw.setTranslateX(x);
-
vw.setTranslateY(y);
-
vw.setTranslateZ(z);
-
-
Rotate xr = new Rotate(rotX, Rotate.X_AXIS);
-
Rotate yr = new Rotate(rotY, Rotate.Y_AXIS);
-
Rotate zr = new Rotate(rotZ, Rotate.Z_AXIS);
-
-
vw.getTransforms().addAll(xr,yr,zr);
-
vw.setVisible(vis);
-
-
ImageView[] im = {vw};
-
double[] ifo = {x,y,z,vw.layoutBoundsProperty().get().getWidth(),vw.layoutBoundsProperty().get().getHeight(),vw.layoutBoundsProperty().get().getDepth(),rotX,rotY,rotZ};
-
koord.add(ifo);
-
Source.add(src);
-
list.add(im);
-
-
}
-
-
public ImageView getImageView(int place){
-
return list.get(place)[0];
-
}
-
-
return list.get(getPlace(src))[0];
-
}
-
-
int i = 0;
-
while(!(source == Source.get(i)[0])){
-
if(i == getSize()){
-
}
-
i += 1;
-
}
-
return i;
-
}
-
-
return Source.get(place)[0];
-
}
-
-
g.getChildren().add(getImageView(n));
-
}
-
-
public static int getSize(){
-
return Source.size();
-
}
-
-
ImageView v = getImageView(src);
-
v.setTranslateX(x);
-
v.setTranslateY(y);
-
v.setTranslateZ(z);
-
add(v,src);
-
}
-
-
Rotate xr = new Rotate(rx, Rotate.X_AXIS);
-
Rotate yr = new Rotate(ry, Rotate.Y_AXIS);
-
Rotate zr = new Rotate(rz, Rotate.Z_AXIS);
-
-
getImageView(src).getTransforms().addAll(xr,yr,zr);
-
add(getImageView(src), src);
-
}
-
-
double[] ifo = {vw.getTranslateX(),vw.getTranslateY(),vw.getTranslateZ(),vw.layoutBoundsProperty().get().getWidth(),vw.layoutBoundsProperty().get().getHeight(),vw.layoutBoundsProperty().get().getDepth(),vw.getTransforms().get(0).getTx(),vw.getTransforms().get(0).getTy(),vw.getTransforms().get(0).getTz()};
-
koord.set(getPlace(sourc), ifo);
-
}
-
-
return koord.get(getPlace(src))[3];
-
}
-
-
return koord.get(getPlace(src))[4];
-
}
-
-
return koord.get(getPlace(src))[5];
-
}
-
-
Point3D p = new Point3D(getImageView(src).getTranslateX(), getImageView(src).getTranslateY(), getImageView(src).getTranslateX());
-
return p;
-
}
-
-
int i = 0;
-
while(!(i == getSize())){
-
st += getName(i);
-
}
-
-
}
-
getImageView(src).setVisible(vis);
-
-
-
}
-
return getImageView(src).isVisible();
-
}
-
}
so ausgeführt
Java Code:
-
-
Cube w = new Cube("Hollo","WallNormal.png", 5, 5, 5);
dabei Rausgekommen ist:
JavaFX Image View Würfel berechnen
Categories: JavaFX Image View Würfel berechnen
Inscription à :
Publier les commentaires (Atom)
0 commentaires:
Enregistrer un commentaire