Man muss bei Blender das UV Mapping benutzen. Einfach auf Youtube gucken.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu // finally apply the gravity
SimpleVector t = new SimpleVector(0, .1f, 0);
t = mainPlayerHitboxSphere.checkForCollisionEllipsoid(t, ellipsoidMainKart, 1);
mainPlayerHitboxSphere.translate(t);
private void rotateKartByWheels(){
SimpleVector t = new SimpleVector(0, .1f, 0);
t = mainPlayerKart.getRightFront().checkForCollisionEllipsoid(t, ellipsoidRightFront, 1);
t.x=0;
t.z=0;
System.out.println(t.y+"|");
mainPlayerKart.getRightFront().translate(t);
t = new SimpleVector(0, .1f, 0);
t = mainPlayerKart.getLeftFront().checkForCollisionEllipsoid(t, ellipsoidRightFront, 1);
t.x=0;
t.z=0;
mainPlayerKart.getLeftFront().translate(t);
t = new SimpleVector(0, .1f, 0);
t = mainPlayerKart.getRightRear().checkForCollisionEllipsoid(t, ellipsoidRightFront, 1);
t.x=0;
t.z=0;
mainPlayerKart.getRightRear().translate(t);
t = new SimpleVector(0, .1f, 0);
t = mainPlayerKart.getLeftRear().checkForCollisionEllipsoid(t, ellipsoidRightFront, 1);
t.x=0;
t.z=0;
mainPlayerKart.getLeftRear().translate(t);
float rightFrontHeight = mainPlayerKart.getRightFront().checkForCollisionEllipsoid(mainPlayerKart.getRightFront().getTranslation(), ellipsoidRightFront, 1).y;
float rightRearHeight = mainPlayerKart.getRightRear().checkForCollisionEllipsoid(mainPlayerKart.getRightRear().getTranslation(), ellipsoidRightFront, 1).y;
float leftFrontHeight = mainPlayerKart.getLeftFront().checkForCollisionEllipsoid(mainPlayerKart.getLeftFront().getTranslation(), ellipsoidRightFront, 1).y;
float leftRearHeight = mainPlayerKart.getLeftRear().checkForCollisionEllipsoid(mainPlayerKart.getLeftRear().getTranslation(), ellipsoidRightFront, 1).y;
if (rightFrontHeight != mainPlayerKart.getRightFront().getTranslation().y){
rightFrontHeight += mainPlayerKart.getRightFront().getTranslation().y;
}
if (leftFrontHeight != mainPlayerKart.getLeftFront().getTranslation().y)
leftFrontHeight += mainPlayerKart.getLeftFront().getTranslation().y;
if (rightRearHeight != mainPlayerKart.getRightRear().getTranslation().y)
rightRearHeight += mainPlayerKart.getRightRear().getTranslation().y;
if (leftRearHeight != mainPlayerKart.getLeftRear().getTranslation().y)
leftRearHeight += mainPlayerKart.getLeftRear().getTranslation().y;
double angleFront=rightFrontHeight-leftFrontHeight;
angleFront=Math.atan(angleFront);
double angleRear=rightRearHeight-leftRearHeight;
angleRear=Math.atan(angleRear);
float rotZ=(float) ((angleFront+angleRear)/2d)*(-1);
double angleLeft=leftFrontHeight-leftRearHeight;
angleLeft=Math.atan(angleLeft);
double angleRight=rightFrontHeight-rightRearHeight;
angleRight=Math.atan(angleRight);
float rotX=(float) ((angleLeft+angleRight)/2d);
// System.out.println(rotX+"|"+rotZ+"|");
mainPlayerKart.getMainPlayerRotationsCube().clearRotation();
mainPlayerKart.getMainPlayerRotationsCube().rotateX(rotX);
mainPlayerKart.getMainPlayerRotationsCube().rotateZ(rotZ);
}
Object 'Sphere.127_jPCT0' created using 960 polygons and 482 vertices.
Processing object from 3DS-file: Sphere.126
Object3D[] tests = Loader.load3DS("models/course1.3ds", 1);
for (Object3D object3d : tests) {
object3d.rotateX((float) Math.PI/2*-1);//mit nem halben PI werden die objekte horizontal angezeigt. Man muss aber den negativen Wert nehmen sonst steht alles auf dem kopf
if (object3d.getName().contains("boden"))
object3d.setTexture("boden");
object3d.compile();
curses.addElement(object3d);
}
Object3D[] tests = Loader.loadOBJ("models/course1.obj", "models/course1.mtl", 0.2f);
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.threed.jpct.Loader.loadOBJ(Unknown Source)
at com.threed.jpct.Loader.loadOBJ(Unknown Source)
System.setProperty("org.lwjgl.librarypath",new File("lib/dll/").getAbsolutePath());
Quotejava -Djava.library.path=C:\pfadmitdendlls\lib\dll -jar meine.jar
Page created in 0.023 seconds with 12 queries.