Recent Posts

Pages: [1] 2 3 ... 10
1
Bones / Re: Loading a Collada file with pre-defined animations
« Last post by raft on December 15, 2017, 12:55:18 am »
can you see the coins in the list?

for textures, one thing you can do is parse the collada file, create a map of object name -> texture  or object index -> texture and set textures accordingly.
2
Bones / Re: Loading a Collada file with pre-defined animations
« Last post by dwightina on December 14, 2017, 11:39:25 pm »
Thanks for the reply! I believe the coins did get exported... if I open the DAE file I see the node/geometry declarations for each one.  The animation is also appearing properly if I preview the file.

As far as the texture issue,  I guess I'm more curious about whether it's possible to get these texture files and set them programatically, instead of me finding the proper index and setting the texture.  The use case is that I will be scanning various target that will each trigger different 3d objects, so I'd prefer not to have to define these beforehand.  Is there no way to handle textures automatically, even if they are predefined in the DAE (using init_from tag)?
3
Bones / Re: Loading a Collada file with pre-defined animations
« Last post by raft on December 14, 2017, 02:57:22 pm »
if there are multiple objects in the collada file, they should be listed in the collada sample like in the screenshot below. in this case there are 4 objects. if your coins is not listed, I guess it means they are not exported



the collada sample just sets the same texture to all objects. you can set different textures to different objects like with the code below. but of course you need the index of object in the group

Code: [Select]
skinnedGroup.get(index).setTexture(name);
4
Support / Re: Will serialization decrease the faces of a .obj file?
« Last post by EgonOlsen on December 14, 2017, 09:38:57 am »
No, not after serialization but maybe before, after loading the model. In some cases, jPCT-AE will optimize away (or add new) faces to an object at load time. But actually, that's very rare and applies to strange models only.
5
Bones / Re: Loading a Collada file with pre-defined animations
« Last post by dwightina on December 13, 2017, 11:42:38 pm »
Perfect, thanks! I've gotten it up and running using that sample.  However, I've noticed that there are some objects that are missing from my animation.  The animation is supposed to be a man holding some coins and throwing them into the air, however the coins don't show up at all. Is there anything I should be looking out for when rendering a DAE that isn't just one solid 'object'?
 Along with that, the coins also have a different texture than the man, so I will be supporting multiple textures.  How is that handled, if at all? Also sorry if this is the wrong place to ask it/if I should be looking into Ardor3D, instead. Thanks again!
6
Support / Will serialization decrease the faces of a .obj file?
« Last post by ScienceHill on December 13, 2017, 11:14:36 pm »
Hello. Suppose I have an .obj file which has 10,000 faces (polygons). After I serialized it with the jPCT-AE Mesh Serializer at here: https://sourceforge.net/p/meshserializer/home/Home/ , I got a .ser file. And I can render it on my Android phone. I just wonder whether the number of faces of this .ser file is also 10,000? In other words, will the number of faces of the .obj model decrease after serialization? Thanks in advance.
7
Support / Re: rendered image is mirrored
« Last post by EgonOlsen on December 11, 2017, 03:35:42 pm »
That's true, I guess. I've replaced the image in the wiki with your image.
8
Bones / Re: Loading a Collada file with pre-defined animations
« Last post by raft on December 11, 2017, 01:12:06 pm »
try using ColladaSample, it displays the animations in the file and you can run them through the GUI
9
Bones / Loading a Collada file with pre-defined animations
« Last post by dwightina on December 11, 2017, 11:54:06 am »
Hi there,

I'm working on importing a Collada file that has pre-defined animations in the DAE.  I've gotten the project to the point where I can see my 3D object, but there is no animation. I've taken a look at ProceduralAnimationSample.java, but am not entirely sure which part to add in order to make this work.  I'm new to this and am sure there is some fundamental information that I don't have, so if anyone can point in me in the right direction that'd be appreciated.

Here is what I currently have:
Code: [Select]
       

//copy the res file to storage
val uri:URI = URI("file://" + outDir.absolutePath)
        val resLocator = SimpleResourceLocator(uri) //URI("android.resource://"+ mActivity.applicationContext.packageName +"/raw/seymour_dae"))
        ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_MODEL, resLocator)

        try {
            val colladaImporter = ColladaImporter()
            colladaImporter.loadTextures(false)
            val colladaStorage = colladaImporter.load("test.dae")

            animatedGroup = BonesImporter.importCollada(colladaStorage, 1f, null)
            animatedGroup!!.isAutoApplyAnimation = false
        } finally {
            ResourceLocatorTool.removeResourceLocator(ResourceLocatorTool.TYPE_MODEL, resLocator)
        }

        for (o in animatedGroup!!) {
            o.setTexture("floor2.jpg")
            o.build()
            o.discardMeshData()
        }
       
        animatedGroup!!.addToWorld(world)

        animatedGroup!!.get(0).skeletonPose.updateTransforms()
        animatedGroup!!.applySkeletonPose()
        animatedGroup!!.applyAnimation()


        //point camera to look at the center of the animated group
        var transformedCenter : SimpleVector? = null
        for (o in animatedGroup!!) {
            o.visibility = true
            transformedCenter = o.transformedCenter
        }
        cam.lookAt(transformedCenter!!)
    }

Cheers
10
Support / Re: rendered image is mirrored
« Last post by chocoman on December 09, 2017, 01:56:47 am »
Thank you, I misinterpreted the image describing the coordinate system on the wiki at http://www.jpct.net/wiki/index.php?title=Coordinate_system
Maybe the attached image would be less ambiguous.
Pages: [1] 2 3 ... 10