Tuesday, April 28, 2009

Calculating the tangent to a Bezier curve

I wrote an article explaining how to find the tangent to a Bezier curve. At least, how I did it in the animation library.

Bezier Curve Tangents

Monday, April 27, 2009

Random number generation

Given the same seed, Mono, using the Random class, produces different random numbers than .net. The remedy to this is to write your own random number generator class so you can be sure the numbers will be the same.

I'm not a math whiz so I did a web search and found a generator written in C# that implements the Mersenne Twister. I have now included this code with a test project on the site: http://bimixual.org/MersenneTwister/

Thanks to the author, Akihilo Kramot.

Eclipse and why I barely tried it out

Currently I want to find a good text editor for Gnome that is as functional and easy to use as TextPad is for Windows. Good luck with that.

After hearing that Eclipse is oh-so-powerful I installed it. Opened it up. Wtf do I do now? So I opened an HTML file. It shows me a rendered view, not the HTML source code. So how do I edit the source code? Why isn't that the default? I don't know. I couldn't find a button or menu item to switch to source view so I did a little searching. I read you need plug-ins to edit different types of docs. So you have to find and install them..it just gets uglier and uglier.

I open the Eclipse help and there is a tutorial. But there is no "next page" button. The first page just has a list of links at the bottom. That does not a tutorial make. Eventually I realize I manually must select the next page of the tutorial from the tree on the left. And it isn't even a tutorial since it doesn't walk you through actually doing something. It just tells you about the windows in the IDE. When do I actually get to do some work? Do I have to read a book before I can edit some HTML?

So I did a search to read what other people think of Eclipse and it isn't pretty. Lots of people hate it. The consensus is that it is too complex and confusing - even for those who (unlike me) have decided to dive into it.

Finally, here is my complaint in short: A new user should immediately be able to work with a program if that user has functional knowledge of other programs in that class. I have used tons of IDE and in every other one of them I could open and edit a file at first blush. I could get syntax highlighting a second blush. But not with Eclipse. If Eclipse is this simple (and I'm too stupid to see it) then the UI is not user-friendly enough.

Tuesday, April 21, 2009

XP fix

I found an XP version that had a problem. I fixed it and now version 0.2.2 is online.

Monday, April 20, 2009

0.2.1 uploaded

version 0.2.1 is now online. See the previous post to read why

Sunday, April 19, 2009

Darn that message structure

Well I don't know how it happened but somewhere along the way I got XP incompatibility on account of the message structure. This is how it was broken:

System.Windows.Form.Message used in Win API message functions (PeekMessage, GetMessage, etc) works in Vista but not XP.

So to do the fix, I made my own message structure that magically works in both XP and Vista:

struct MSG

{

IntPtr hwnd;//HWND hwnd;

uint message;//UINT message;

long wParam;//WPARAM wParam;

long lParam;//LPARAM lParam;

UInt32 time;//DWORD time;

IntPtr pt;//POINT pt;

};

This is not in the current source code on the site. But you can implement it yourself if so inclined.

Monday, April 13, 2009

Version 0.2 is released

I just uploaded my newest version. 3 significant changes:

  1. BezierSprites calculate normals and tangents so sprites can angle themselves appropriately
  2. Put thread to sleep between frames therefore not using 100% as it previously did. Although it is worth noting that the previous version was still fully cooperative and had no negative impact on other apps.
  3. More use of static methods where the results of their calculations can be useful elsewhere

I have not updated the UML diagram. I'll get around to it.

Download from http://bimixual.org/AnimationLibrary as usual.

oh yeah, this is not backward compatible with v0.1. Since I suspect I have no serious users of that version, I figured I'd let it slide.