getRoot().getTransformedCenter() is Weird

Started by AGP, July 15, 2014, 10:27:10 PM

Previous topic - Next topic

AGP

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?

raft

i dont think so. getTransformedCenter() is a method of core jPCT. what do you mean exactly by weird?

AGP

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

raft


AGP


AGP

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

Check out the distance printout as the models approach each other.

raft

i'll look into it when i return to city. a few days later

raft

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

AGP

Is one not approaching the other? If not, move one by pressing the UP key.

raft

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

AGP

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).

raft

Quote from: AGP on August 01, 2014, 10:15:35 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 ;)

raft

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.

AGP

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.

raft

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.