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 - AGP

Pages: [1] 2 3 ... 108
1
Support / Re: Float Positioning Blit Images
« on: September 07, 2018, 08:05:44 pm »
Quote
That's a whole different beast. Would it be sufficient to have them without depth buffering?

Is that like that one I did by extending Polylines? If so, no. ; )

I still haven't solved that displacement issue with AWTGLCanvas, by the way. I don't mean to be pushy but I dream of a day when you update the lwjgl version.

2
Support / Re: Float Positioning Blit Images
« on: September 04, 2018, 11:45:20 pm »
And software-rendered Polylines, please?

4
Bones / Re: getBindPose() is Late
« on: July 10, 2018, 11:44:19 pm »
Yet another attempt. This is based off of SkeletonDebugger. It's still not quite right:

Code: [Select]
     private void updateWeaponPos() {
SimpleVector o = weapon.getTransformedCenter();
SimpleVector d = getJointPosition(rightHand);
SimpleVector left = model.get(0).getXAxis();
weapon.translate(d.x-o.x, d.y-o.y+.1f, d.z-o.z);//d.x-o.x, d.y-o.y+.125f, d.z-o.z

//NOW ROTATION:
Skeleton skeleton = model.get(0).getSkeleton();

final int parentIndex = skeleton.getJoint(rightHandIndex).getParentIndex();
if (parentIndex != Joint.NO_PARENT) {
     Object3D bone = weapon;
     updateWeapon(bone, skeletonPose.getGlobal(parentIndex), skeletonPose.getGlobal(rightHandIndex));
}
     }
     private void updateWeapon(Object3D weapon, final Matrix start, final Matrix end) {
SimpleVector from = start.getTranslation();
SimpleVector to = end.getTranslation();
SimpleVector direction = to.calcSub(from);

weapon.getRotationMatrix().setTo(direction.getRotationMatrix());
weapon.rotateY((float)Math.PI+rotY);//rotY IS SO THAT THE WEAPON ROTATES ALONG WITH model.getRoot()
weapon.rotateAxis(weapon.getZAxis(), (float)Math.PI*.2f);
     }

Notes:
-Adding the weapon to the root of the character breaks the whole thing.
-I'm having to rotate the weapon by the same amount as the root because it otherwise doesn't chase the hand.
-It kind of looks right until you look straight at the hand and you see that the weapon is not facing the right direction during any given animation

5
Bones / Re: getBindPose() is Late
« on: July 08, 2018, 11:39:19 pm »
My next best attempt was this (but it doesn't look quite right):

Code: [Select]
weapon.getRotationMatrix().interpolate(weapon.getRotationMatrix(), skeletonPose.getLocal(rightHandIndex), 1f);
weapon.getRotationMatrix().matMul(model.get(0).getWorldTransformation());

6
Bones / getBindPose() is Late
« on: July 07, 2018, 08:32:52 pm »
Can I forcefully update it in order to have an item keep up with my character's hand?

7
Support / Re: Asymmetrical Scaling
« on: July 05, 2018, 08:50:40 pm »
That works, thank you. But it begs the question: why would an Extended Primitives cylinder object space not be at the origin?

8
Support / Re: Asymmetrical Scaling
« on: July 04, 2018, 03:06:45 am »
On the other hand, this time it may well be a Java bug:
Quote
Why does array[idx++]+=a increase idx once in Java 8 but twice in Java 9 and 10?
https://blog.takipi.com/stack-overflow-answers-the-top-java-questions-we-didnt-know-we-had/

9
Support / Re: Asymmetrical Scaling
« on: July 04, 2018, 02:56:55 am »
This still displaces it, but in a different direction:

Code: [Select]
     public void thicken(final float deltaTime) {
SimpleVector[] vertices = this.getSourceMesh();
SimpleVector[] destination = this.getDestinationMesh();
final SimpleVector c = new SimpleVector(obj.getTransformedCenter());
for (int i = 0; i < vertices.length; i++) {
     SimpleVector v = new SimpleVector(vertices[i]);
     v.x -= c.x;
     v.y -= c.y;
     v.z -= c.z;
     v.x *= (1f+deltaTime);
     v.z *= (1f+deltaTime);
     v.x += c.x;
     v.y += c.y;
     v.z += c.z;
     destination[i] = v;
}
this.updateMesh();
     }

10
Support / Re: Asymmetrical Scaling
« on: July 03, 2018, 01:50:16 am »
It works both ways, but it's getting displaced as it gets wider. Read that last version of thicken() and you'll see my many attempts to keep the center in the same place.

11
Support / Re: Asymmetrical Scaling
« on: July 01, 2018, 01:41:03 am »
Because I'm altering its vertices with the VertexController.

12
Support / Re: Asymmetrical Scaling
« on: June 29, 2018, 07:49:09 am »
ClearRotation() doesn't do anything (and it shouldn't, since I interpolate the matrices of the lightsaber and the skeletal structure's hand in the loop). ClearTranslation fixed its initial position, thanks very much.

Now, I'm having a hard time keeping glow in the same place. I've tried every permutation of the following method of which I could think:

Code: [Select]
     public void thicken(final float deltaTime) {
SimpleVector[] vertices = this.getSourceMesh();
SimpleVector[] destination = this.getDestinationMesh();
final SimpleVector c = new SimpleVector(obj.getTransformedCenter());
float minX = Float.MAX_VALUE, minZ = Float.MAX_VALUE, maxX = Float.MIN_VALUE, maxZ = Float.MIN_VALUE;
for (int i = 0; i < vertices.length; i++) {
     SimpleVector v = new SimpleVector(vertices[i]);
     v.x *= (1f+deltaTime);
//      v.x -= deltaTime*.5f;
     v.z *= (1f+deltaTime);
//      v.z -= deltaTime*.5f;
     destination[i] = v;
     if (minX > v.x)
minX = v.x;
     if (maxX < v.x)
maxX = v.x;
     if (minZ > v.z)
minZ = v.z;
     if (maxZ < v.z)
maxZ = v.z;
}
this.updateMesh();
SimpleVector d = new SimpleVector((minX-maxX), 0f, (minZ-maxZ));
obj.translate(d);
// obj.clearTranslation();
// obj.calcCenter();
// Glow.moveTo(obj, c);
// Glow.moveTo(obj, d.calcSub(c));
     }

13
Support / Re: Asymmetrical Scaling
« on: June 28, 2018, 06:38:11 pm »
The glow object is the child of blade (obj in Glow class).

14
Support / Re: Asymmetrical Scaling
« on: June 28, 2018, 10:05:23 am »
The original object, blade (obj in the Glow class) is an ExtendedPrimitive. Glow itself is a copy of blade (new Object3D(obj, false)).

15
Support / Re: Asymmetrical Scaling
« on: June 27, 2018, 07:04:58 pm »
It would've been crazy if they weren't in the same place.

Quote
******Blade Bounds:
0.18368883, 0.22368883
-1.0867921, -0.08679211
0.9159291, 0.95592904
******

******Glow Bounds:
0.18368883, 0.22368883
-1.0867921, -0.08679211
0.9159291, 0.95592904
******

Pages: [1] 2 3 ... 108