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 ... 110
Bones / Re: BonesIO Question
« on: August 03, 2020, 11:24:56 pm »
No, one compares the values, the other tests if they're the same instance.

Bones / Re: BonesIO Question
« on: August 01, 2020, 08:36:32 am »
I made the SkinClips work (in the sense that they're filled properly) by making a custom serializer and deserializer for them. But now I'm getting the same instancing issue with Skeletons. So I wrote the hacky method below and called it at the very end of the appropriate AnimatedGroup constructor. Now when I comment out the if (skeleton != pose.skeleton) test in SkinClip.applyTo(...), my model gets all bunched-up once, then doesn't animated at all (but doesn't crash, either) again.

Code: [Select]
private void attemptSkeletonInstanceFix() {//Gson Skeleton instance crap
     SkinClip lastClip = skinClipSequence.getClip(0);
     if (lastClip.getSkeleton().equals(objects[0].getSkeleton()) && lastClip.getSkeleton() != objects[0].getSkeleton()) {
lastClip.skeleton = objects[0].getSkeleton();
     for (int i = 1; i < skinClipSequence.getSize(); i++) {
if (lastClip.getSkeleton().equals(skinClipSequence.getClip(i).getSkeleton()) && lastClip.getSkeleton() != skinClipSequence.getClip(i).getSkeleton())
     skinClipSequence.getClip(i).skeleton = lastClip.getSkeleton();
lastClip = skinClipSequence.getClip(i);
     for (Animated3D object : objects)
object.currentPose.skeleton = objects[0].getSkeleton();

Bones / Re: BonesIO Question
« on: July 29, 2020, 10:31:48 pm »
I'm stuck, now, at an Exception in thread "main" java.lang.IllegalStateException: there is already a channel for joint 84. But I'm serializing the data as-is. I wonder if it's related to the potentially null instances of JointChannel in SkinClip.iterator().

Bones / Re: BonesIO Question
« on: July 17, 2020, 08:34:02 am »
Thanks for replying. My problem is Gson's fault. Clean, near-identical to yours, code produced a perfect model, loaded quickly, but with many copies of the same Skeleton. It turns out that Gson doesn't do instances very well. I'm working on a registerTypeAdapterFactory solution which is producing NullPointerExceptions for SkinClipSequences (but for no other class, including Skeleton and SkeletonPose). I also tried Jackson with no success, so I returned to Gson. I expect to succeed soon, and I will post the sources for BonesIO, AnimatedGroup and Animated3D here.

Bones / Re: BonesIO Question
« on: July 11, 2020, 12:19:21 am »
This is not that old, much more ambitious project, by the way. I came very close to exporting a fully-ready, animated and textured, JSON-serialized model right out of both Max and Blender. This is just so I can get Bones out of Java. But I suspect that if you answer at all it will be with, "I don't know."

Bones / Re: BonesIO Question
« on: July 10, 2020, 08:36:30 pm »
That's right. The question was: how? When I'm doing the same thing with JSON, I'm getting identical copies of the skeleton (the model loads but no animation will work).

Bones / BonesIO Question
« on: July 10, 2020, 06:56:38 am »
How is it that when you load your SkinClipSequences from a bones file instead of each SkinClip having identical Skeletons they each share the same instance of a Skeleton?

Support / Re: Cpct?
« on: November 22, 2019, 08:30:37 am »
You're a good man, Egon. You were right, the texels[] were black. I'm forced to use the following rather slow nested loop, but voilá, it works.

I think that I'm going to tackle a skeletal structure for it before I try my hand at a hardware renderer, but the eventual C# hardware renderer will benefit from direct access to OpenGL.

Code: [Select]
    int i = 0;
    for (int y = 0; y < image.Height; y++)
for (int x = 0; x < image.Width; x++)
     texels[i++] = (uint) image.GetPixel(x, y).ToArgb();

Support / Re: Cpct?
« on: November 21, 2019, 07:26:03 pm »
I applied my ReverseBytes to the texels and still got black. Actually, at first I got fully-transparent, then I switched the bitwise OR for a bitwise AND for alpha as follows and I was back to black.

Code: [Select]
private static System.UInt32 ReverseBytes(System.UInt32 value) {
    value = (value & 255);//MAKE OPAQUE IT's AN OR IN SoftGLRenderer. WHY?
    return (value & 0x000000FFU) << 24 | (value & 0x0000FF00U) << 8 | (value & 0x00FF0000U) >> 8 | (value & 0xFF000000U) >> 24;

Support / Re: Cpct?
« on: November 20, 2019, 07:37:24 pm »
Loading an image is a simple call to Image.FromFile(filename). Which leaves us the texture coordinates. Would that be in Object3D?

Support / Re: Cpct?
« on: November 20, 2019, 01:33:54 am »
OK, done. Same thing: single-colored textures work, images don't (and the images aren't null, either).

Support / Re: Cpct?
« on: November 19, 2019, 08:34:24 am »
I haven't ported ExtendedPrimitives, but my second model was sphere from Primitives (first one was an OBJ sphere). Same problem.

Support / Re: Cpct?
« on: November 18, 2019, 12:42:08 am »
And blue looks really blue. The problem, then, has to be in the texture coordinates, don't you think? And where might I fix them? And don't say the Loader class, because the same problem happens with multiple formats (and I have to have gotten at least one right lol).

Support / Re: Cpct?
« on: November 18, 2019, 12:28:22 am »
I didn't know it always used a white texture. This is what it looks like with a green texture applied:

Pages: [1] 2 3 ... 110