Hi, all:
Sorry for my stupid question but I’ve got to ask all of you a question…
I debugged into ObjectFile.class and try to understand how to use setCoordinates() and getCoordinates()…
After loading a 3D object from the file “a.obj”, the debug information at the following line in file ObjectFile.class tells that
coordArray is of length 75,972
gi.setCoordinates(coordArray);
However, after “a.obj” has been loaded into a Scene “s” and I just use the following lines of code
BranchGroup bg = s.getSceneGroup();
Shape3D obj3d = (Shape3D)bg.getChild(0);
GeometryArray ga = (GeometryArray)obj3d.getGeometry();
GeometryInfo gi = new GeometryInfo( ga );
Point3f[] myCoordArray = gi.getCoordinates();
The length of myCoordArray is 183,947 .
It’s strange that getCoordinates() and setCoordinates() of GeometryInfo are not a pair ?? Am I right?
Furthermore, how to update the coordinates (in .obj file, the “v” lines) in a Shape3D ?
I mean, if I loaded a .obj file, setCoordinates() will load 75,972 "v"s.
But, I would like to update these loaded coordinates with another 75,972 coordinates.
I thought I could make it just by another setCoordinates() of GeometryInfo, however, the loaded object displays wrongly.
Then, I tested why it’s wrong by getCoordinates().
I found, although the original setCoordinates() only affords 75,972 coordinates,
after loading the object, getCoordinates() informs 183,947 coordinates.
Where am I wrong? And How to update those coordinates?
Thanks very much.
Best Regards
JIA