www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: AGP on July 15, 2014, 10:27:10 pm

Title: getRoot().getTransformedCenter() is Weird
Post by: AGP on July 15, 2014, 10:27:10 pm
As you translate a model by its root, its transformed center values don't look right even as the model moves the right way. I believe that that is a bug. Is it?
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on July 16, 2014, 08:35:29 am
i dont think so. getTransformedCenter() is a method of core jPCT. what do you mean exactly by weird?
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on July 16, 2014, 08:31:02 pm
The distance between the results grows even as the models approach each other. See this thread: http://www.jpct.net/forum2/index.php/topic,4017.0.html (http://www.jpct.net/forum2/index.php/topic,4017.0.html)
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on July 17, 2014, 09:18:28 am
can you send me a test case please?
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on July 18, 2014, 09:55:15 am
I will make you one soon, thank you.
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on July 24, 2014, 11:17:25 pm
Sorry I took this long. I made this one less neat than I wished, but, alas, here it is: https://dl.dropboxusercontent.com/u/93826015/BonesCenterTester.rar (https://dl.dropboxusercontent.com/u/93826015/BonesCenterTester.rar)

Check out the distance printout as the models approach each other.
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on July 25, 2014, 08:20:42 am
i'll look into it when i return to city. a few days later
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on July 31, 2014, 10:46:00 am
i've run your test case. what exactly should I look into? what i see is two ironman's are looking each other, idle animation is running and nothing else happens ???
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on July 31, 2014, 10:05:37 pm
Is one not approaching the other? If not, move one by pressing the UP key.
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on August 01, 2014, 10:00:14 am
strange ??? i have no idea what causes that. meanwhile you can use AnimatedGroup.getRoot().getTranslation() instead of getRoot().getTransformedCenter(). that seem to work correct. since root is a dummy object with no triangles its transformed center and its translation are the same.

btw, sometimes keys dont work that's why I couldnt find move key in the first time. this is a windows 8.1 machine
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on August 01, 2014, 10:15:35 am
That's a Java focus thing (either I added KeyMapper to the frame or to the Canvas and it's supposed to be the other one). Very likely it's a Java events bug, but as long as you don't mess with the frame (just start the program and don't ALT-TAB or anything) it should always work.

For my program, I have solved the position issue by adding a child object and getting its center, but it would be nice to figure out what this issue is (and potentially solve it).
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on August 01, 2014, 10:19:28 am
but it would be nice to figure out what this issue is (and potentially solve it).
agreed. i'm very curious what kind of a strange bug causes this ;)
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on August 05, 2014, 03:45:14 pm
i guess there is no problem here. you set center's of root objects that's why getTranslation and getTransformedCenter return different values. that's also the reason of numeric distance is increasing when objects visually come closer.
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: AGP on August 07, 2014, 11:10:49 pm
I don't get it. How would the distance grow either way? And if I ever called setCenter on root, it was to solve this very issue. Try removing it and see.
Title: Re: getRoot().getTransformedCenter() is Weird
Post by: raft on August 08, 2014, 09:34:24 am
and there is also another problem. see the screenshots. in the first the model is bind pose, in the second its animated. as you see the skeleton and the model moves somewhere else when animating. you can load your model into LoadBonesFormatSample and see yourself. so root's transformed center or translation does not reflect the actual place of the model.

this is either caused by wrong skinning or the exporter, not sure.

(http://s29.postimg.org/tfhrjbfmf/bones_agp_1.png)
(http://s22.postimg.org/4odo0znkh/bones_agp_2.png)