Page 3 of 3

Re: Snorunt Evo Line

PostPosted: 03 Jun 2013 20:00
by zorakirby
I'm having severe problems with rotation/offsets. Is anybody here a Trigonometry expert?

Re: Snorunt Evo Line

PostPosted: 03 Jun 2013 20:12
by SPG
im no expert, but i do know trig

Re: Snorunt Evo Line

PostPosted: 03 Jun 2013 21:52
by MrMasochism
what are the problems you are having?

Re: Snorunt Evo Line

PostPosted: 04 Jun 2013 14:22
by zorakirby
I think I figured out what the problem is, but I don't know how to fix it. I actually ended up getting the Bones rotating correctly. However, the vertices go off in weird directions. I spent a couple hours last night trying to get it working, but eventually I was too tired to keep trying, so I went to bed. Today, I was trying it again, and just now I had the realization that I think the vertices are rotating around the correct Bone locations, but using global rotations instead of local ones. For example, I have a bone rotating on its x axis as it also spins on its z axis . The vertices, on the other hand, instead orbit the bone around the global x axis, then orbit on the global z axis, giving the completely wrong location.

If you guys know how to fix this, it would be awesome, because this is practically the only thing that isn't working in the smd loader. I read something about "quarternions" maybe being related to rotating correctly, but then I searched it on wikipedia, and I was like, "huuuuh?" :?

Edit: I just realized that I don't think that even the bone movement is right. The bone that looks like it's working is only working because the parent bone's "tip" location is only moving over one axis, so in that case, global rotation is practically equal to local rotation.

Re: Snorunt Evo Line

PostPosted: 04 Jun 2013 15:23
by MrMasochism
The issue is likely to be the order that rotations are applied. Try switching them around and see how that goes

Re: Snorunt Evo Line

PostPosted: 04 Jun 2013 15:53
by zorakirby
MrMasochism wrote:The issue is likely to be the order that rotations are applied. Try switching them around and see how that goes


If only it were that simple. I've tried numerous combinations, even making the rotation negative, with no success. I'm pretty much certain that the reason is that global rotation is being used when it should be local, because of the way the vertices move. I just finished javadoc'ing all the important stuff; if anyone has an idea, i could upload it. Otherwise, I'll just keep at it until it works

Re: Snorunt Evo Line

PostPosted: 04 Jun 2013 17:12
by zorakirby
Ok, I think I can actually figure this out. I searched up "lwjgl bone animation rotation" on google, and not only did I find some information that will solve this problem, I also found a topic on StackOverflow called "Importing 3D skeletal animations from .smd model". No Joke.
There are a number of Vector/Matrix related things I gotta do, and I've never really done, like, anything with matrices, but I just now got code working that creates a 4x4 "matrix view" of the Bone's location and rotation, and it was really easy. Expect the animation loader to be working later today (i do have to go to work in 1 hr, for 4 hours, so most likely not), tomorrow, or, at the latest(I can't guarantee it though, never know what problems I might run into) the day after.

Re: Snorunt Evo Line

PostPosted: 04 Jun 2013 17:48
by MrMasochism
If you need a hand with it get in touch with me sometime when I'm home. I'm sure that paper I took on matrix algebra will come in handy

Re: Snorunt Evo Line

PostPosted: 05 Jun 2013 03:15
by zorakirby
YOU. GUYS.
GUESS WHAT'S WORKING?
:mrgreen: :lol: :mrgreen: :D :lol: :mrgreen: :mrgreen: :mrgreen: :D

Re: Snorunt Evo Line

PostPosted: 05 Jun 2013 03:26
by SPG
the power to unpixelize watermelon from games and get it in the real world to eat? AMAZING!