Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
hab nun ne andere lösung gefunden:
java Code:
/*
* robotArm.java
*
* Created on 29. Mai 2007, 12:54
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package roboterarmv2;
import com.sun.j3d.loaders.Scene;
import org.j3d.loaders.stl.STLFileReader;
import org.j3d.renderer.java3d.loaders.STLLoader;
import com.sun.j3d.utils.universe.*;
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;
import javax.media.j3d.*;
import javax.vecmath.*;
/**
*
* @author gnadirap
*/
public class robotArm {
private final static int STAND_NUM = 0; // index of "stand" Pose
private TransformGroup objectTG; // TG which the loaded object hangs off
private TransformGroup roboObjects[];
private Transform3D t3d, toMove, toRot; // for manipulating objectTG's transform
private int currPoseNo, maxPoses; // Pose number info
private boolean isActive; // is the sprite active?
private STLLoader RoboArm;
private STLFileReader roboReader;
private Scene scene;
private DecimalFormat df;
private Hashtable countHT;
private int countTG;
private Collection collHT;
private File aFile = new File("c:/BG_Robo_C_STL.stl");
/** Creates a new instance of robotArm */
public robotArm() {
df = new DecimalFormat("0.###"); // 3 dp
loadPoses();
// create a new transform group for the object
objectTG = new TransformGroup();
objectTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
objectTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
roboObjects = scene.getViewGroups();
System.out.println(countTG+"\n");
//objectTG = roboObjects[];
t3d = new Transform3D();
toMove = new Transform3D();
toRot = new Transform3D();
isActive = true;
}
private void loadPoses(){
RoboArm = new STLLoader();
try{
roboReader = new STLFileReader(aFile);
} catch (Exception e){
e.printStackTrace();
}
try {
//RoboArm.load(aFile.toURL());
scene = RoboArm.createScene(roboReader);
countHT = scene.getNamedObjects();
countTG = countHT.size();
} catch (Exception fnfe){
fnfe.printStackTrace();
}
}
public Scene getScene(){
return scene;
}
public TransformGroup getTG(){
return objectTG;
}
}