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.

Advertisements

One Response to “Java Web Start for Cranktrain Simulation”

  1. Yung-Chang Tan Says:

    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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: