Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

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

Pages: [1] 2 3 ... 13
1
General Anim8or Forum / Re: OT - Hi there
« on: December 24, 2009, 05:55:25 am »
Thanks!

Wish you all a Merry Christmas and a Happy New Year,
may all of your dreams come true!

Have fun,
Francesco

2
General Anim8or Forum / OT - Hi there
« on: December 20, 2009, 10:06:08 am »
Hi people,
nice to get back here again.
I've been away and completely disconnected from Anim8or for quite a while - sorry, I completely dropped the BVH converter too.

I'll start having a look around and get updated on the latest news,
hope you're all fine and well,
all the best,
Francesco

3
Thanks everybody :D

Andrew, I'm not sure if I got your sentence right:
Quote
I ran hooker walk through truspace then resaved it. Don't think it will make much difference. seems to have just changed the frame rate! Reason? Sometimes the bvh files act weird in parts regardless of the software. Truesoace tends to filter it somehow.

Do you mean that importing the hooker walk into truespace gives more or less the same problems that my video shows, I mean, the legs bending at weird angles sometimes?

I'm asking because I'm getting crazy to find a combination that gives a result that matches perfectly the animations that bvhacker gives of that BVH file.

Technical issue again: the order of rotations in BVH is ZXY, whereas I suppose Anim8or's order to be XYZ. I've read somewhere that this order can be meaningful depending on the animation you want to represent with euler angles, in particular to avoid gimbal lock.

Being that ZXY works fine with BVH, I suppose that a mere conversion of order would not get a perfect result in Anim8or.

So the question is: being that Anim8or too stores angle motion in eulers, does it suffer from the same gimbal lock issues? In other words again, shal I build the skeleton aligning it to another axis and switch rotations around, in order to get a perfect match?

I hope that someone out there can illuminate me on it.

4
I was definitely lost in a glass of water.

So far, the only problem about the code I pasted above is about the eulers to quaternion function, which exchanges roll with pitch or something like this - at least is seems to be so.

So, the basis pose seems to be worked out. I'm attaching a picture that shows the basic pose of a BVH file (I guess that this pose isn't OK for easy skinning). Adding the starting t-pose as you requested is not done yet, Andrew.

After having fixed the skeleton conversion, I realised that the motion angles cannot be fed to Anim8or in the raw way, because BVH and AN8 use different rotation orders.

Nonetheless, using the raw motion data I've made a simple render showing the hooker walk taken from Animazoo.com

As you can notice, most of the animation goes fine, but the lower section of both legs bends to weird angles (more the motion, more the error when feeding erroneous rotation order).

So, this is what my converter can do so far. As soon as I sort out the rotation order conversion I will share the executable.

The video inside of the zip file is an XviD, fyi.

Enjoy!

5
ASL Scripts / Re: RIBRobin
« on: December 20, 2008, 02:41:36 pm »
Wait, I think I mistaken your problem.

If I got it right, you already have cam's orientation and position worked out, correct? Now the thing you want to do is to calculate the inverse orientation and offset of the entire scene (if I got it right once again).

I met a similar problem while working on the magnet scripts, and I ended up with this code (snipping another post of mine):

quaternion $mag_q, $clay_q;
$mag_q = $magnet.orientation;
$clay_q = $clay.orientation;

float4x4 $mag_rotmat, $clay_rotmat;
$mag_rotmat = toFloat4x4($mag_q);
$clay_rotmat = toFloat4x4($clay_q);

/* invert orientation quaternion for building inverse transformation */
$mag_q = ( -$mag_q.x, -$mag_q.y, -$mag_q.z, $mag_q.w);
$clay_q = ( -$clay_q.x, -$clay_q.y, -$clay_q.z, $clay_q.w);

float4x4 $mag_inv_rotmat, $clay_inv_rotmat;
$mag_inv_rotmat = toFloat4x4($mag_q);
$clay_inv_rotmat = toFloat4x4($clay_q);



If you want to, you can change a simple point go back and forth on the two systems using code like this:

/* translate clay point to magnet's coordinates */
$clay_p = $clay_rotmat.Project($clay_p) + $clay_l - $mag_l;
$clay_p = $mag_inv_rotmat.Project($clay_p);

...and back:
/* translate back clay point to clay's coordinates */
$clay_p = $mag_rotmat.Project($clay_p) - $clay_l + $mag_l;
$clay_p = $clay_inv_rotmat.Project($clay_p);


But if your problem involves changing the orientation quaternion of each object, then I think this link could help you more than me:
http://www.flipcode.com/documents/matrfaq.html

I did not face nor dig this passage in particular, but I think it's about multiplicating quaternions together... have a look and good continuation.


6
ASL Scripts / Re: RIBRobin
« on: December 20, 2008, 02:21:10 pm »
Unfortunately I'm stuck on the inverse problem (converting from eulers to quaternion) for my BVH->AN8 conversion, and being that I'm not on firm ground with quaternions, I could really help to mess things up instead ;)

Let's hope on a tip falling from higher floors ;)

7
It's nice to see workarounds implemented, glad to see that you had a try at that.

The praxinoscope is cool, and, would you guess? It reharsed another old idea in my mind, thank you for the pointer once again!

8
You're welcome Andrew, I hope to sort things out asap.

Crossing fingers ;)

9
Another small update.

Maybe it is all only working in my mind, or maybe I'm just a single step away from having a working solution.

Sorry if I get into technical details, but the problem I'm stuck on is pretty technical.

The concept a BVH file relies on is:
- a hierarchy of joints whose distances are stored as relative XYZ offsets
- each joint starts as "non rotated"
- each frame rotates each joint by a certain roll, pitch and yaw angles

Now to get this into anim8or I could either:
- go with the best, longer way of converting each joint to a bone and recompute all the motion angles, frame by frame;
- go with the work-it-around, shorter way of recreating non-rotated joints with zero-length rotating bones, interleaving them with fixed bones to represent offsets, and direct-stream copy the RPY angles from BVH motion into AN8 sequence;

I took the workaround way, and as I said above, I miss one single step to close the process.

The thing I miss is converting joint offsets to quaternion orientation, in order to set it into the figure section, inside of the an8 project. Or better, I have a chunk of code for that, but the quaternions I'm getting seem to be wrong, when I feed them to anim8or.

To have an example of the final result, take a look to the bvh and an8 files attached, they show the same skeleton and the same animation in both programs (bvhacker and anim8or), but the orientation of the anim8or bones is the result of manual editing - hence the name, "desired result.an8".

This is the code I'm using to convert XYZ offsets to RPY angles, which get then converted to a quaternion. Anyone has enough trig and quat knowledge to tell me what's going wrong with it?



/*
Radians(x, y) returns the angle between the positive X axis and the
line connecting origin and P(x,y).
This function work correctly, hence I'm not reporting it here
*/

/*
heading, attitude and bank are only other names for roll, pitch and yaw
I'm using this function as taken from
http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
*/

quaternion RadRPYtoQuat(float heading, float attitude, float bank) {
  // Assuming the angles are in radians.
  float c1 = cos(heading/2);
  float s1 = sin(heading/2);
  float c2 = cos(attitude/2);
  float s2 = sin(attitude/2);
  float c3 = cos(bank/2);
  float s3 = sin(bank/2);
  float c1c2 = c1*c2;
  float s1s2 = s1*s2;
  quaternion result;
  result.w = c1c2*c3 - s1s2*s3;
  result.x = c1c2*s3 + s1s2*c3;
  result.y = s1*c2*c3 + c1*s2*s3;
  result.z = c1*s2*c3 - s1*c2*s3;
  return result;
}


point3 BoneRPY(point3 p) {
  float roll, pitch, yaw;
  yaw = -Radians(p.y, p.x);
  p.y = p.y * cos(yaw) - p.x * sin(yaw);
  roll = Radians(p.y, p.z);
  pitch = 0;
  return point3(roll, pitch, yaw);
}

int main() {

/*
  parse the BVH file, get nodes and so on
  then:
*/

  point3 p = BVH_Node.Offset;
  p = BoneRPY(p);
  quaternion q = RadRPYtoQuat(p.x, p.y, p.z);
  AN8_Bone.orientation = q;

/*
  store bone into figure hierarchy, print out the an8 file and so on
  end of the story
*/

}


The BoneRPY() function is the part I'm not sure about. In my mind, I'm getting the yaw from a mere projection, I'm rotating a coordinate to avoid angle misrepresenting and I'm getting roll. Two euler's angles should be enough to get every possible orientation, isn't it?

I feel lost, really, hope somebody could help me sorting this out.

PS: rename "test.bvh.txt" removing the ".txt" part, I've added it to let the forum accept it as attachment. It's a trivial issue, just matter of clarity.


[Edit: Anim8or expects quaternions to be stored in xyzw order, am I right? It seems to be so, but I ask to be sure]

10
ASL Scripts / Re: RIBRobin
« on: December 19, 2008, 01:26:05 pm »
Very good idea Raxx, wish you good time coding it - and by the way, there is always "a better way", so, as long as the program does the work, I wouldn't mind about getting it earlier or later, and neither I would mind about it being the "neatest" or the "hardest crucher" ;)

The model is great!

11
ASL Scripts / Re: Customizable 3D ship hull script (demo included)
« on: December 19, 2008, 01:20:23 pm »
Very useful script NickD, well done.

My two cents are about getting around the insufficient input features: you can keep it as a normal script and rely on object's attributes to allow customization - the user sets one or more attributes and runs the script which will use attributes for custom parameters keeping the others to default values.

Keep on, scripts like this are a good thrust toward quick production.

12
Thank you guys, although I'm not sure about what you are speaking about.

It is half of my fault, because here in this thread I've presented two things:
- some ways to get around the missing animated materials;
- an idea about a new feature (the "exchange objects" view-portals made with special objects/materials);

The thing that interests me the most is the latter, although I find the former to be useful too.

Well, in any case, the idea is there.

13
Thank you all people for your interest, I hope to finish it as soon as possible.

Thank you Andrew for the pointer about BVHacker, it will be good to check out if I am doing everything correctly. About setting the figure object in t-pose or in *-pose, I'm still far from having completely worked out the BVH format, but nonetheless I have a small update, and I will do my best to implement your request.

So, I've completed the AN8 project export part and most of the data conversion.

To sum up, I can feed the program with the BVH file and get a AN8 project containing all the animation data, but I'm not yet done with the nodes->bones conversion to build the AN8 figure.

It is more tricky than I thought in a first time, but I'm working it out step by step.

I've added an option to resample the animation data scaling down the frame rate. As test file I am currently using a BVH file I got from Animazoo, the one with the Capoeira flying kick. It's a 900+ frames file sampled at 120fps, and I'm getting a AN8 file with a single bone (the hips) moving and rotating in scene mode, sampled at 30fps. That's not so much but you can guess the satisfaction I felt seeing this very first export working in Anim8or.

Some loudthinking now, just in case you guys have some good advice or pointer to give.

-------

The BVH file can store more than a skeleton at once, and each rootnode, unlike Anim8or's rootbones, is able to rotate and to translate in space. I have converted this concept by building a figure for each skeleton and by adding a motion track in scene mode for each figureelement (read this as "figure+sequence in scene mode").

Conceptually I am on firm ground here with the multiple-skeleton stuff, but I need a BVH file containing a multiple skeleton, in order to feed it both to my software and to BVHacker and check out if everything is running smooth. Can somebody provide me with such a file?

-------

About stripping out more of that large amount of animation data, apart from resampling it at a lighter framerate, I thought about computing out peaks and pauses for each joint motion, but it's a tricky thing for sure and I'll leave it for later, when the raw conversion will be complete and stable.

On the way to get there, I'll add another option to pick out a fixed amount of frames per second and set the keyframes with them.

-------

I'm making the program as a console executable, you will be able to drop "file.bvh" onto it and get a "file.bvh.an8" straight away, there will be also the option to change the conversion preferences via program arguments or by interacting with the program.

-------

More to come, wish you good time Anim8ing meanwhile ;)

14
Still a long way to go, but I think I have worked out most of the things I need to know to save the final .an8 converted file. Though, most of these things are still only in my mind - as for actual code, I've just fixed the bug I mentioned above, so far I only have the BVH loader complete.

More to come, as soon as I have something really working I will post it in a separate thread - thanks for hosting me in this topic so far Andrew ;)

15
General Anim8or Forum / Re: Ani2Pov v0.56 and LibAn8 v8.12.13 Updated
« on: December 14, 2008, 10:51:32 am »
Good to see progress in such useful tools Texel, keep on the good work.

Pages: [1] 2 3 ... 13