Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - dcfingerprint

Pages: [1]
Bones / Positioning and orienting Object3D with a Bones joint?
« on: December 08, 2016, 10:18:51 pm »

I'm interested in dynamically adding an Object3D to the world and positioning/orienting it relative to a particular Bones Joint in an Animated3D.   

For example - to place an dynamically created object in the hand of a model, and keeping it aligned with the hand as it moves/rotates.  (Or a hat on the head of a model, which will stay on the head, regardless of how the model animates.) 

Any tips for getting the position and rotation to use with either Object3D.setTranslationMatrix(), setRotationMatrix(), or using Object3D.translate(x,y,z) / rotateX(), rotateY(), rotateZ() / rotateAxis() ? 

The Object3D to "attach" could either be a sibling of the Animated3D root, or a child.

Any code samples would be appreciated.  Thanks!

Still getting an exception, but in a different location:

 java.lang.ArrayIndexOutOfBoundsException: length=44; index=1330
    at com.threed.jpct.Mesh.calcNormalsFast(
    at com.threed.jpct.Mesh.calcNormals(
    at com.threed.jpct.Object3D.calcNormals(
    at raft.jpct.bones.Animated3D.attachVertexController(
    at raft.jpct.bones.Animated3D.<init>(
    at raft.jpct.bones.AnimatedGroup.clone(

Support / Re: ShadowHelper - shadows cast close to receiver
« on: October 28, 2016, 01:48:45 am »
Thanks!  A combination of reducing the bias and using setCullingMode(false) addressed the issue for this case.   Much appreciated.

Support / Re: ShadowHelper - shadows cast close to receiver
« on: October 27, 2016, 11:06:53 pm »
More examples attached.  See area around foot nearest floor.

Support / ShadowHelper - shadows cast close to receiver
« on: October 27, 2016, 09:53:33 pm »
Hi there,

Been trying out ShadowHelper in the new JPCT-AE along with some animated characters. 
Generally works great!  However, I have noticed some artifacts where shadows do not appear to render properly on the receiver when the casting object (in this case a bones character) is very close. 

In particular, you can see in the images below, the feet of the characters result in a "hole" in the shadow when the feet are near or on the floor.   I've tried experimenting with raising the object further up off the floor - and then it looks OK at some point (no "holes"), however then the scene of course doesn't look right since the character appears floating above the floor, instead of standing on it. 

All objects/meshes from the character are added as casters, and the floor is the single receiver.

Code: [Select]

                Projector projector = new Projector();
                sh = new ShadowHelper(mRenderer.mFrameBuffer, projector, 1024);

                projector.setClippingPlanes(1f, 1000f);
                projector.setFOVLimits(0, 999);
                float fov = projector.convertDEGAngleIntoFOV((float) fieldOfView);



                int intColor = Utils.parseColor(shadowColor);
                int red =;
                int green =;
                int blue =;
                sh.setAmbientLight(new RGBColor(red, green, blue));

                AnimatedGroup group = getGroup(casterName);
                if (group != null) {
                    for (Animated3D a : group) {

Any ideas for config or anything else I may be doing wrong?  Example image attached.


Would it be possible to test by trying with this bones file?  It loads and works fine, animates properly, etc.  Cloning while re-using mesh works fine (as long as this is done prior to any animation).  It is only when attempting to clone (using animatedGroup.clone(false) (not reusing mesh), that the JPCT-AE exception occurs.  Exception at same location also occurs with another completely different model.

I am interested in cloning with reuseMesh false so that I can keep one cached in memory (not attached to a World) and then quickly add multiple copies to a world and have them be able to animate independently.   If I clone with reusing mesh then subsequent clones are disfigured after animating (probably expected) - however please let me know if there's another way to do this (resetting animation prior to clone doesn't seem to help).


FATAL EXCEPTION in thread: GLThread 248
java.lang.ArrayIndexOutOfBoundsException: length=1640; index=1640
    at com.threed.jpct.Mesh.compress(
    at com.threed.jpct.Mesh.cloneMesh(
    at com.threed.jpct.Object3D.copy(
    at com.threed.jpct.Object3D.<init>(
    at raft.jpct.bones.Animated3D.<init>(
    at raft.jpct.bones.AnimatedGroup.clone(

I've seen this exception for a couple of models now when attempting to clone an AnimatedGroup loaded via Bones with reuseMesh = false.  (The model was converted from Blender to Ogre to .bones using    Not a problem in general but has occurred with specific models from completely different sources.  Any ideas?  I can send the .bones file if needed.  Thanks!

Pages: [1]