PickShowTool generates "java.lang.IllegalArgumentExcept

Found a bug? Post here.
Post Reply
paul peters
Posts: 17
Joined: Thu 6. Mar 2008, 15:18
Location: TU Berlin, Germany
Contact:

PickShowTool generates "java.lang.IllegalArgumentExcept

Post by paul peters » Tue 24. Feb 2009, 15:41

In some situations (see example below) PickShowTool generates a "java.lang.IllegalArgumentException". I found that the current pick of the ToolContext has 4 vector as world coodinates whose last component is zero.

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();
	}
}

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Post by gunn » Tue 10. Mar 2009, 13:40

Can you copy and paste the stack trace at the time of the exception? That would help the debugging effort.
jReality core developer

paul peters
Posts: 17
Joined: Thu 6. Mar 2008, 15:18
Location: TU Berlin, Germany
Contact:

Post by paul peters » Wed 8. Apr 2009, 12:10

Code: Select all

created Toolkit: de.jreality.swing.FakeToolKit6@b25b9d
scene root is root
Exception in thread "jReality ToolSystem EventQueue" java.lang.IllegalArgumentException: Infinite euclidean translation vector
	at de.jreality.math.P3.makeTranslationMatrix(P3.java:657)
	at de.jreality.math.MatrixBuilder.translate(MatrixBuilder.java:287)
	at de.jreality.tools.PickShowTool.perform(PickShowTool.java:118)
	at de.jreality.toolsystem.ToolSystem.processToolSet(ToolSystem.java:530)
	at de.jreality.toolsystem.ToolSystem.processTriggerQueue(ToolSystem.java:430)
	at de.jreality.toolsystem.ToolSystem.processToolEvent(ToolSystem.java:316)
	at de.jreality.toolsystem.ToolEventQueue$1.run(ToolEventQueue.java:79)
	at java.lang.Thread.run(Thread.java:619)
Vendor = NVIDIA Corporation
Have automipmap generation = true
Paul Peters

paul peters
Posts: 17
Joined: Thu 6. Mar 2008, 15:18
Location: TU Berlin, Germany
Contact:

Re: PickShowTool generates "java.lang.IllegalArgumentExcept

Post by paul peters » Thu 27. May 2010, 19:48

This bug has disappeared.
Paul Peters

Post Reply