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.


Topics - dcfingerprint

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

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!

2
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]
                ShadowHelper.setShadowMode(GLSLShadowInjector.PCF_FILTERED_SHADOWS);

                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);
                projector.setFOV(fov);
                projector.setYFOV(fov);

                projector.setPosition(sv);
                projector.lookAt(caster.getTransformedCenter());

                sh.setLightSource(projector);

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

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

                sh.addReceiver(receiver);
Any ideas for config or anything else I may be doing wrong?  Example image attached.

Thanks!

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

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 jmeOgre2Bones.sh.)    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]