« Home | Make Movies » | Contact Joint Summary » | Dual-space Expansion for Estimating Penetration de... » | Trouble With The Projection » | Contact Manifold & Signed Distance Map » | Intersection and Penetration Depth » | Crank Model Now Works » | Constraint Force Mixing » | Linear-Time Dynamics using Lagrange Multipliers » | Piston Assembly Simulation »

Java Web Start for Cranktrain Simulation

I have put out a Java web start version of cranktrain simulation for a while. The tricky thing about Java web start is loading a data file. After reading all the available document on the web (which is very little), I learned that ClassLoader is necessary to invoke files in the JAR file.

ClassLoader cl;

crankShape = Trimesh.loadObj(cl.getResource("images/crank.obj"));

I used Java3D ObjLoader class to load the OBJ files. However, I am still confounded about how to directly read a text file in a web start app. The combustion force file was stripped from the current web start version of the crank model until I figured out a way to do it.

Since the load method of ObjFile works fine with a URL argument, I finally gained access to Java3D source code to look into the implementation.

reader = new BufferedReader(new InputStreamReader(url.openStream()));

This code seems to be working.

Post a Comment