Hi,
I am using ObjectFile to load a file called "cube.obj" (this is a simple txt
file that has been created using notepad). This file contains information
about the cube. Is the following the correct format of the information
contained in such a file.
v 1.0 1.0 1.0
v -1.0 1.0 1.0
v -1.0 -1.0 1.0
v 1.0 -1.0 1.0
v 1.0 1.0 -1.0
v -1.0 1.0 -1.0
v -1.0 -1.0 -1.0
v 1.0 -1.0 -1.0
f 1 2 3 4
f 8 7 6 5
f 1 4 8 5
f 6 7 3 2
f 1 5 6 2
f 7 8 4 3
Is it ok just to pass "Cube.obj" as the filename, as shown in the example
code below, because when I run my program the file does not get loaded.
public ObjectLoader(String args[]) {
if (args.length > 0) {
filename = args[0];
VirtualUniverse myUniverse = new VirtualUniverse();
Locale myLocale = new Locale(myUniverse);
myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
myLocale.addBranchGraph(buildContentBranch(buildCube()));
setTitle("ObjectLoader");
setSize(400,400);
add("Center", myCanvas3D);
setVisible(true);
}
}
public static void main (String[] args) {
String[] InputFile = {"cube.obj"};
ObjectLoader sw = new ObjectLoader(InputFile);
}
P.S Do you know where I could get an example of program that reads in values
such as veticies, colour etc. from a text file to create a 3d object.
Thanks,
Grace
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".