On Friday 25 July 2003 20:37, Vicky wrote:
> Dear all,
>
> I have a question regarding one program called ObjLoad in Java3D demo.
> It can display 3D object loaded from .obj format. Is there anyone of you
> know, how Java3D store and manipulate the 3D Object internal, in which data
> format. What happens if there are two objects, for example we introduce a
> simple geometry like cube in the scene.Do we need to make a new obj file
> for the cube?
Vicky,
One thing you can do is extract named groups from an .obj with ease, that may
be enough. Essentially it lets you enclose several (usually related) objects
in the .obj.
here's some simplified code (no try/catch)
ObjectFile f = new ObjectFile(flags, (float)(0 * Math.PI / 180.0));
Scene s = null;
s = f.load(tankObject);
java.util.Hashtable views = s.getNamedObjects();
Shape3D shape1;
Shape3D shape2;
for (Enumeration e = views.keys() ; e.hasMoreElements() ;) {
String current = (String) e.nextElement();
if (current.equals("name1")) {
shape1 = (Shape3D) views.get(current);
} else if (current.equals("name2")) {
shape2 = (Shape3D) views.get(current);
}
}
Cheers,
Will.
--
William Denniss - will@: http://www.omegadelta.net
===========================================================================
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".