Paul
Code: Select all
import paulpeters.jreality.geometry.IndexedFaceSetFactoryRT;
import de.jreality.geometry.IndexedFaceSetFactory;
import de.jreality.math.MatrixBuilder;
import de.jreality.scene.SceneGraphComponent;
import de.jreality.tools.PickShowTool;
import de.jreality.ui.viewerapp.ViewerApp;
import de.jreality.vr.ViewerVR;
public class PickShowToolBug {
public static void main(String[] args) {
final ViewerVR vvr = ViewerVR.createDefaultViewerVR(null);
final IndexedFaceSetFactory wallIFS=new IndexedFaceSetFactoryRT();
wallIFS.setVertexCount(4);
wallIFS.setVertexCoordinates(new double[][]{{0,0,0},{0,0,1},{0,1,0},{0,1,1}});
wallIFS.setFaceCount(1);
wallIFS.setFaceIndices(new int[][]{{0,1,3,2}});
wallIFS.update();
final SceneGraphComponent wallSGC = new SceneGraphComponent("wall");
wallSGC.setGeometry(wallIFS.getIndexedFaceSet());
final SceneGraphComponent wallSGC2= new SceneGraphComponent("wall2");
wallSGC2.setGeometry(wallIFS.getIndexedFaceSet());
MatrixBuilder.euclidean().translate(3,0,0).assignTo(wallSGC2);
final SceneGraphComponent sgcAll=new SceneGraphComponent();
sgcAll.addChildren(wallSGC,wallSGC2);
vvr.setContent(sgcAll);
sgcAll.addTool(new PickShowTool());
final ViewerApp viewerApp = vvr.initialize();
viewerApp.update();
viewerApp.display();
}
}