Andreas,

We started working on this but with an almost complete lack of
documentation it's basically trial and error (and I haven't made much
progress).  If you've got more information about how all this works I'd
be glad to add support to our loader.

- John Wright
Starfire Research

Andreas Jerke wrote:
>
> Hi All,
>
> I have testet several importers for 3DS files and
> all don`t support correct reading of chunk 0x4160 .
> This chunk contains 12 float values describing an
> 4*3 matrix, with which all vertices of an object
> must be transformed.
>
> Most 3DS files exported from 3DSMax contain this chunk.
>
> Me problem is, that the objects in my imported 3DS scene
> are not in the correct position/scaling/rotation.
>
> I tried to implement this chunk in the
> org.opentools.java3d.ThreeDSProcessor.class ,
> but I get wrong results.
>
> Does anyone know how to transform all vertices with
> the matrix ?
>
> Does anyone know which 3DS importer supports 0x4160 ?
>
> Best regards,
> Andreas
>
> extension to org.opentools.java3d.ThreeDSProcessor from
> Aaron Mulder's 3DS Loader,
> http://www.j3d.org/utilities/loaders/3ds/mulder.html
>
> <schnipp>
> [...]
>
>                 case TYPE_MESH_MATRIX:
>                     //offset for this object !
>                     float rmatrix[] = new float[16];
>
>                           //read rotate/scale matrix (CORRECT ORDER ???)
>                     rmatrix[0]=readFloat();
>                     rmatrix[3]=readFloat();
>                     rmatrix[6]=readFloat();
>
>                     rmatrix[1]=readFloat();
>                     rmatrix[4]=readFloat();
>                     rmatrix[7]=readFloat();
>
>                     rmatrix[2]=readFloat();
>                     rmatrix[5]=readFloat();
>                     rmatrix[8]=readFloat();
>
>                           //read transformation vector
>                     Point3f trans = new
> Point3f(readFloat(),readFloat(),readFloat());
>
>                     Matrix3f matrix = new Matrix3f(rmatrix);
>                     debug("Transform all vertices with matrix
> \n"+matrix);
>
>                           //center of current object, calculated from
> bounding box (DO I NEED THIS ???)
>                     Point3f center = new Point3f(
>                             -((omaxx-ominx)/2+ominx),
>                             -((omaxy-ominy)/2+ominy),
>                             -((omaxz-ominz)/2+ominz)
>                         );
>                     //transform all vertices, >BUGGY<
>                     for (int i=0; i<vertices.length; i++) {
>                         debug("before:"+vertices[i].toString());
>                         vertices[i].add(center);
>                         matrix.transform(vertices[i]);
>                         vertices[i].add(trans);
>
>                         debug("after:"+vertices[i].toString());
>                     }
>                     break;
>
> </schnapp>
>
> ===========================================================================
> 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".

===========================================================================
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".

Reply via email to