Monday, November 29, 2010

COLLADA rant

Ok, having added OgreXML support, and our own personal skeletal animation file format support, I decided to add COLLADA support to our skeletal animation system because art puke types are always talking about how great it is.

Now, COLLADA is a good idea that has been horribly HORRIBLY implemented. It is the very definition of needlessly complex and convoluted, the documentation is absolutely terrible, and to top it off, none of the exporters actually support the spec - only parts of it AND THEY SUPPORT IT DIFFERENTLY DEPENDING UPON THE TOOL USED. WTF? LOL.

Anyhow, I stumbled upon a real doozy this past week when supporting the 'library_animations' element. I came across a sample file with baked matrices (meaning that the rotations/translations/scales/et al. were all baked down into representation by a single matrix) that did something so bizarre I couldn't understand it for about 4 hours even though it was staring me in the face and even then I said "it can't be... It just can't be." Oh, but I was wrong, it was.

Apparently, COLLADA allows (and some exporters do this) animation data for a given set of keyframes to be exported not just as a giant clump of keyframes (all animations globbed together) but stored on an individual matrix element basis. I know, sound confusing/bizarre and you probably don't know what I mean by that so I will try to explain since I don't know a very concise way of explaining something that strikes me as so batsh*t crazy that I cannot fathom how some ultramaroon implemented this or though it was a good idea (maybe someone can enlighten me on this...)

What I mean is that even though COLLADA can already bizarrely store all animations lumped together as disassociated keyframes on a per bone basis (strange but I can understand why they might want to do this) storing a set of 16 floats per keyframe (representing a 4x4 matrix) - there is another format to the storage of this data that creates a child XML node FOR EVERY ELEMENT OF THAT 4X4 MATRIX AND STORES EACH KEYFRAMES VALUE FOR THAT PARTICULAR ELEMENT IN A FLOAT ARRAY.

If that still isn't clear (and probably wouldn't be for me because I'd be thinking - "no way, I'm not reading that correctly..." - I mean there's an actual XML element under:

<library_animations>
     <animation id="MySkeleton_Root">
          <source id="MySkeleton_transform_0__0_-output">

If the file has, say, 600 keyframes of animation in it, there will be (no sh*t) 600 floats in a float array under that source ID that are meant to be stuff in 600 different 4x4 matrices in the position MyMatrix[0][0]...

It strikes me as absolutely crazy as a loon to see 16 entries under a given bone with each entry holding a huge float array representing an individual element of a 4x4 matrix. WTF?

Why, for the love of all things holy and good, would you not simply store the damn thing as a float array of 16 * 600 floats under a single element? The matrix is baked - you can't extrapolate the original DCC toolset translations and orientations (although you can pull translations and orientations out you have no idea whether they're the exact ones used by the tool to generate the matrix) so WTF?

Sorry, that was just the cherry on the cake of my dealings with COLLADA, the amazing file format that seems to be dying a slow death at the hands of Khronos (who I like, but man is this a weird thing they've got here.)

*** END OF RANT ***

Thursday, September 30, 2010

It is ridiculous that there seem to be no reasonable explanations of skeletal animation

...and that includes in books (there's a book devoted to it but it's a little horky [props to Nathan for the word], and the only other book I've seen on the topic depends on DirectX code to handle many things.)

I'm going to put one up on this blog shortly as I ran into someone looking for this information and I was shocked to find that Googling was not very helpful as there are bits and pieces of the information all over the place. It would be very helpful, I presume, for someone to post everything you really need to do from importing file formats (I'll probably explain OgreXML and maybe Collada as well), to blending vertex and skeletal animation, to skinning.

I know I wish someone had done that for me back in 1999. Hopefully I'll get it up this year. Probably a short series of posts starting with the background, the terminology (lots of terms for the same things [i.e. Bind Pose/Reference Pose, Palette Matrix/Inverse Model Space Matrix, et cetera...]

It will all be CPU based skinning so that it applies potentially to any language. Hmmm... I wonder if anyone has ever put a skeletal animation system in Flash before (I hate ActionScript/Flash programming, but that might be interesting.)

Wednesday, March 10, 2010

Nerd score...

It's certainly obvious how to game this thing but an honest evaluation led to:


I am nerdier than 84% of all people. Are you a nerd? Click here to take the Nerd Test, get geeky images and jokes, and talk on the nerd forum!


I'm nerdier than I thought...

Sunday, January 17, 2010

Lemonade... That cool refreshing drink...

After the fast last week, I didn't think I'd be hot for lemonade anytime soon; however, for some reason I had the urge for a glass of real lemonade today. I'd never made 'real' lemonade before but since I have some leftover lemons, I went ahead and took a tall glass (probably a little more than 20 fl. oz.) and put the juice from a good sized lemon in there, filled it with cold water and added a heaping teaspoon of suger. Stirred. Drank. Yeow! Sour. Ok, more sugar. Two more heaping teaspoons full. Stir for a few minutes to dissolve that much sugar into cold water. Taste. Delicious!

My daughter Kate wandered over and asked for a taste and since it was still really tart even though it was also sweet - I figured she'd make a face like 'Daddy you should not have given me that' but instead she started chugging. She then suggested that I help her (by picking her up and standing her on the kitchen counter) obtain the drinking cup of her choice and she would allow me to fill it with lemonade for her. She's very thoughtful that way. 5 minutes later, she was back for more lemonade. So, I had a little bit of tasty tasty lemonade today, and Kate had the rest.

Java JRE, IE8, and 64-bit systems...

I just put Windows 7 Ultimate on my HP QuadCore laptop, and after downloading and installing the latest 64-bit JRE from SUN, I found that it didn't appear to actually install properly. Applets wouldn't load, but java showed up through the command line. So, I went to 'manage add-ons' in IE8, and saw only 1 of the usual 2 SUN plug-ins. I figured I'd just had a screwy install, so I removed, re-downloaded (you never know) and re-installed. Bang, same problem.

At this point, I usually slow down and ensure I'm not being a complete idiot about something and I carefully evaluate my actions. Yes, this is Windows 7 Ultimate x64, yes I downloaded the x64 JRE 6, update 17. Ok, time to google. People having problems with this? After sifting through the inevitable mountains of detritus trying to find a nugget of useful information (should I have used Bing? ;)) I ran across a tiny little comment in forum about 17 posts down saying "Make sure it's IE8 x64 you're using..." Click. No way, I thought. I could understand and appreciate why Microsoft would install two versions of IE8 on an x64 system, but I figured there's no freakin' way the default IE to be used would be the 32-bit version, right? Wrong.

Turns out that that the default IE8 that shows up 'pinned' to the taskbar is the 32-bit version. Jerkoffs... So, 30 seconds later I had both added a quick launch toolbar to the tastbar (some idiot decided to remove this from Windows 7) and replaced 'IE8' with 'IE8 (x64).' Bingo applets showed up.

Friday, January 15, 2010

'Bad image exception" running C# code on Windows 7

We just ran into this problem with one of our tools when someone ran a C# application on Windows 7 (although it isn't supported just yet on that platform.) Turns out that the issue was related to a 64-bit Windows 7 .NET installation loading and referencing 32-bit modules. If everything used in the application was 32-bit, it would be fine; but, you can't mix and match. Since this application makes use of modules hosted by the operating system, the 64-bit modules load and the 32-bit application image tries to map the 64-bit image for usage. BLAM...

This article describes the problem:

http://www.gcn.com/Articles/2009/07/09/5-Tips-for-Developing-with-64-Bit-Windows.aspx

Looks like a recompilation is due... Great, I just love maintaining two images and builds for the same tool.

Who doesn't miss Gary Larson?


Some of the funniest things I've ever seen came from his hands... Someone sent me this picture today and I thought I'd share it.

Thursday, January 14, 2010

Lemonade Fast - Day #5

It's over! A lot of lemons, maples syrup, distilled water, and 10 pounds later...

This fast is really boring, but quite effective especially if you need to drop weight quickly for some reason (but I don't think this is a very wise way to lose weight as it very likely stresses your body unnecessarily.)

I didn't do this fast for dieting purposes but I must say that compared to diets I've used in the past, this approach had no headaches, and after the first day the hunger wasn't too bad. It cleans you out too :).

Jake informed me that he had some watered down oatmeal this morning and his stomach is unsure as to how to react; so, I'll wait 'til later this afternoon to probably introduce solids again.

I think a smoking hot Lamb Vindalo is probably not a good choice. Maybe a bean burrito with nothing else in it.

Let's see how much weight comes back on over the next two days.

Wednesday, January 13, 2010

Lemonade Fast - Day #4

Okay, day four has arrived.

Not unusually tired. Have been sleeping really well since the fast started. No headaches to report. Hunger is a little stronger, but not too bad. Salt water is becoming more revolting instead of less (I presumed it would get easier.)
So...

Salt water flush - check.
Salt water effectiveness - check.
Ability to smell the neighbors two houses over cooking bacon when I took the dogs out this morning - check.
Actual string of drool slipping temporarily unnoticed from my mouth when sitting with the kids at dinner tonight - check.
Sheer and utter boredom with this fast - check...

God/Allah/YHWH - be praised, Jake has informed me that he was very tired today and may make tomorrow his last day on the fast. I will, of course, remain on the fast approximately 8 seconds longer and then dive headfirst into the refridgerator. Should Jake change his mind, I may, instead, cry myself to sleep tomorrow night dreaming of a Johnny's double cheese/double pepperoni. Shit. I just made drool fall out of my mouth and onto my desk.

Pray with me people that Jake remains stout of heart in his quest to end the fast tomorrow.

Tuesday, January 12, 2010

Lemonade Fast - Day #3

Alright, day 3, time to blog a bit (it's 5:15PM and I plan to update around 3PM usually if I can) - what can I say? I must be physiologically strange. I'm not particularly hungry. I'm hungry sort of like you are maybe an hour before lunchtime. Just a slight feeling of 'empty belliedness-ness.'

The salt water flush still works as advertised. Another 7 trips (in two hours this time.)

I did realize that the drink tasted vile yesterday because the second bottle of syrup I used has a terrible smell and taste akin to maple syrup mixed with soy sauce. I switched back to the syrup I used on day 1 and have been much happier with the results.

I have lost about 8 pounds so far. I don't feel particularly tired; perhaps a tiny bit tired. No headaches - which is what I really was worried about.

Although I don't *feel* particularly hungry, I do find myself thinking about food a fair amount, but nothing specific. I made my youngest daughter's lunch today (my wife didn't realize she was being cruel by calling and asking me to... Or maybe she did... Hmmm...) and the smell of her cut up grilled hot dog, fresh french fries, and apple slices was enticing.

Another thing I was expecting to happen, but hasn't, is for the cold to affect me more than usual. I'm normally a very warm person (unlike my friend Jeff who shows up as 'background' when viewed through an IR camera - really) and I put off a lot of waste BTUs, so when I diet I tend to actual get a little cold. This has not, as of yet, begun to happen.

Anywho, back to finish the workday and dream about what I shall eat first 7 days from today.

Monday, January 11, 2010

Lemonade Fast - Day #2

Hmmm... I am caught in two minds right now. Part of me already detests this 'drink' (I'm being charitable when using the term drink, I assure you) but the other part of me acknowledges that I feel cleaner already and I haven't had any of the usual headaches associated with fasting (probably due to the pure carbohydrates represented by the maple syrup.) You'd think that maple syrups taste pretty much the same but the 32 ounce bottle received yesterday tastes pretty vile compared to the one I had on day one. Anywho...

I can report that, after playing indoor soccer last night, I've already dropped 4 pounds, but I expect that to be it for a while. Jake, who is much lighter than me, reports having lost 5 pounds already. I should also relay that the second partaking of the 'salt water flush' was incredibly, uh... 'successful'? Yeah, it worked. 15 minutes after drinking it (I made it a bit more salty this morning) I found myself thanking God that our house has 6 bathrooms in it (the first time ever for that, lol.) 7 trips later over the course of an hour and a half and I'm sure I'm even lighter as we speak ;).

Hunger was pretty strong yesterday, especially around lunchtime, but I slept really well last night and I did not wake up hungry at all. I don't usually eat breakfast in any case so perhaps my body is saving the starvation feelings for later; however, it is already 3:30PM and I've had 3 glasses of the gunk so far and I'm not hungry at all. I have heard that tomorrow and the next day are the worst though.

I should admit that after drinking all that 'lemonade' yesterday I was actually looking forward to the herbal tea and it didn't disappoint. I felt like a little old granny lying back and really REALLY enjoying a cup of herbal tea with no sweeteners in it. Heh.

I need to try working out today as I got in some decent cardio yesterday, let's try weights today. More to post tomorrow!

Sunday, January 10, 2010

Lemonade Fast - Day #1

My buddy Jake and I decided to try out the 'Lemonade Fast' from the Master Cleanse program; primarily to see if we still had the will power of our youth, and also due to the proposed health benefits (plus some secondary weight loss.)

The premise to this 10 day fast is that heavy quantities of fresh citrus in distilled or other unfluoridated water will cleanse your digestive tract. The 'lemonade' also contains organic grade b maple syrup (because you need some calories to get through the day) and, oddly enough, cayenne pepper (I've heard this is because it will keep your metabolism boosted, help prevent immune system depression due to the fasting, and because it is sadistic.)

So, today, Sunday, January 10th, 2010 is the first day of our great adventure. I went over to Jake and Erin's this morning as excited as kid headed off to bootcamp. Excited, amped up, and more than a little anxious... ;) Now, besides the 'lemonade' there are supposed to be two other facets of this program, an herbal laxative tea in the evenings and a 'salt water flush' in the mornings. When I got to Jake and Erin's, Jake had jumped the gun and already downed a quart of warm salty water. Jake also reported that the 'flush' worked extraordinarily well. (Note to self, only consume the salt water flush when within 50 yards of a functioning toilet.) Erin, who is not partaking in the fast, did want to try the flush so she started drinking it while Jake and I began concocting the 'lemonade.'

The recipe for the lemonade for a single, 10 fl. oz. serving is:

8 fl. oz. Unfluorodated Spring Water (distilled water works)
1 fl. oz. (2 Tbsp) Grade B Organic Maple Syrup
1 fl. oz. (2 Tbsp or 1/2 a lemon) Fresh Lemon or Lime Juice (squeezed)
1/10 Tsp Cayenne Pepper

The recipe for the salt water flush is:

32 fl. oz. Water
2 Tbsp Uniodized Sea Salt

Since both Erin and Jake had partaken of the 'flush' I decided, what the hell, I might as well get used to it now. Mmmm... So not tasty. I didn't have a hard time drinking it down but probably because I just imagined that I was drinking some overly salty soup (and it helped that the water was pretty warm.)

Alright, on to the lemonade. We made our respective containers of the 'drink' and we decided to make a whole day's supply (10 servings) so we used:

8.5 fl. oz. (we didn't have 10 ounces each on us, but we will tomorrow)
5 Lemons (it looked like a lot of juice but it came out to 20 Tbsp)
1 Tsp Cayenne Pepper
80 fl. oz. Unfluorodated Water

Well, it tastes... Unusual. Lemonade and maple syrup actually combine really well and could make the basis for a great vodka cocktail; however, the cayenne pepper gives it a really 'unusual' sort of kick.

Anyhow, Jake and Erin had the rest of their Sunday to get on with and I had to get back to my house as my in-laws were getting ready to depart, so I took my fresh jug of 'drink' back to my house and waited for the effects of the salt water flush to take place.

2 hours later - nothing. Hmmm, maybe I'll get better results tomorrow. Since I'd had no significant digestive action I decided to have my first glass of lemonade. It was, strange. It doesn't taste bad, it actually tastes surprisingly good if you can overlook the cayenne pepper (which I hope I can learn to do.) I didn't enjoy the glass, but it has been about 20 minutes now and I feel good in that the cayenne actually gives you a little warming feeling.

In any case, it is early days yet and we'll see how the rest of this experiment goes. Only 9 days left!