Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 02:10:24 pm
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)Collada
Pages: 1 [2]
Print
Author Topic: Collada  (Read 2135 times)
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #15 on: 22. July 2010, 11:43:29 am »

Wouldn't it work to store a duration for each key frame and use this time instead of the same time for all key frames, if given?

I'm already using time values (not duration) for keyframes anyway.
The point is in that keyframes should be associated with bones rather than with KeyFrameController.
The controller will have 2 keyframes - placeholders as I realize it now.
Logged

Anton
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #16 on: 29. July 2010, 04:44:38 pm »

Hi Marvin,

Which geometry type would be better to use for collada: TRIANGLE_ARRAY or another?


Thanks
Logged

Anton
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #17 on: 29. July 2010, 07:24:07 pm »

Yes
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #18 on: 06. August 2010, 07:14:20 pm »

Hi Marvin,

I've called Geometry.getNormals( int vi, float[] ) and got exception:

Code:
java.nio.BufferUnderflowException
at java.nio.DirectFloatBufferU.get(DirectFloatBufferU.java:221)
at org.jagatoo.geometry.GeomNioFloatData.get(GeomNioFloatData.java:259)
at org.jagatoo.geometry.GeometryDataContainer.getNormals(GeometryDataContainer.java:771)
at org.xith3d.scenegraph.Geometry.getNormals(Geometry.java:978)
at org.xith3d.loaders.models.animations.SkeletalKeyFrameController.<init>(SkeletalKeyFrameController.java:387)

Do I something wrong or maybe there's a bug (in GeometryDataContainer.getNormals() )?

My code:
Code:
        this.bindPoseCoords = new float[shape.getGeometry().getVertexCount() * 3];
        this.bindPoseNormals = new float[shape.getGeometry().getVertexCount() * 3];
        geom.getCoordinates( 0, bindPoseCoords );
       
        geom.getNormals( 0, bindPoseNormals );

GeometryDataContainer:
Code:
    public void getNormals( int vertexIndex, float[] floatArray )
    {
        if ( !hasNormals() )
            throw new IllegalStateException( "No normals defined" );
       
        for ( int i = 0; i < floatArray.length / 3; i++ )
            normals.get( vertexIndex + ( i * 3 ), 3, normalsOffset / 4L, floatArray, i * 3, 3 );
    }


Regards,
Logged

Anton
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #19 on: 07. August 2010, 12:13:01 am »

I don't know the collada code much better than you. I would have to search through the code just as you would Wink.

Marvin
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #20 on: 07. August 2010, 08:24:53 am »

I don't know the collada code much better than you. I would have to search through the code just as you would Wink.

This is not the collada code but is the general jagatoo code Wink.
I guess the code below should contain i instead of i * 3 in both places:
Code:
    public void getNormals( int vertexIndex, float[] floatArray )
    {
        ...
        for ( int i = 0; i < floatArray.length / 3; i++ )
            normals.get( vertexIndex + ( i * 3 ), 3, normalsOffset / 4L, floatArray, i * 3, 3 );
    }

I hesitate to modify general code without your blessing  Grin.
Logged

Anton
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #21 on: 07. August 2010, 10:44:17 am »

Sure, go ahead Smiley.
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #22 on: 15. October 2010, 06:55:22 am »

Hi Marvin,

Finally I can report that I'm ready to commit Collada fix.
Sorry that it took so long time.

Collada loader is working on test models - `match stick' and `fantassin'.
Test models are exported from Blender using unofficial fix of plugin script that can be downloaded from here.

The loader is working now in the similar way as other loaders do.

Would you like to preview the changes before commit (at least xith3d part)?
Logged

Anton
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #23 on: 15. October 2010, 08:36:54 am »

I trust you. And tbh, any change to the curernt collada loader can only be an improvement. So just go ahead and commit it. I will certainly have a look at the changes though just to stay tuned.

Thanks a lot for the fix and don't worry about being too late or something. Good things need time.

Marvin
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 111

197432680
View Profile
« Reply #24 on: 15. October 2010, 09:50:10 am »

commited.
Logged

Anton
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic