Click here to Skip to main content
15,890,932 members
Articles / Mobile Apps / Windows Mobile

Pocket AniEd - Pocket PC Based Animation Editor

Rate me:
Please Sign up or sign in to vote.
3.47/5 (17 votes)
27 May 2004CPOL8 min read 62.9K   255   19   7
Pocket AniEd allows anybody to quickly and easily make beautiful and smooth animations without a background in computer animation or any unnecessary complexity.

Sample Image - pocketanied.jpg

Introduction

Pocket AniEd allows anybody to quickly and easily make beautiful and smooth animations without a background in computer animation or any unnecessary complexity. See the ‘Getting Started Animating’ section of the official Pocket AniEd site to see how easy it is to create your own animations. You can even export your animations to SVG (sort of like Flash) which can be posted on the web or included in Word, PowerPoint, or many other document types. Pocket AniEd was written in C# using Microsoft Visual Studio .Net 2003 and the .NET Compact Framework. It was based on my earlier Tablet PC based animation editor Ink AniEd, but the majority of code was rewritten to better suit the Pocket PC environment.

This is also an experiment in pen-based computing and hopes to embody the power of this interface as opposed to more common mouse oriented systems. One of the principals of Pocket PC development is that when it comes to drawing, it is faster to create a new stroke than to correct and old one; and this lies at the heart of Pocket AniEd. Most modern animation systems have you create a static object and then animate it with rotations, scales and other transforms, however, AniEd has you simply recreate the new object at a different time and then interpolates between the shapes for you. Hopefully, this will lead to a more intuitive user interface and one which makes rapid animation prototyping take just as long if not shorter than single frame diagramming. Consider a professor teaching a class, most of the good professors will draw diagrams and explain the process occurring as they draw the diagram. With AniEd, the process of drawing is the same as that of animating, so while the professor loses no time during his talk, at the end, not only has the student seen the process being created, but he can also now see it animating!

Using the code

The Pocket AniEd code has all sorts of little features and tools, but probably the most useful ones relate to using Point[]s as paths. For instance, re-sampling a path so that there is approximately an equal distance between each point (this looses very little quality and also means that you very easily interpolate between paths). Also, stuff like hit detection, interpolation, re-sampling to a different size, etc. Take a look at the InkInterp class in AniEd.cs to see more.

Points of Interest

Pocket AniEd is based on my previous pen-based animation system Ink AniEd. However, Ink AniEd was designed exclusively for the Tablet PC using all its fancy Ink based features, and also so that it could be seamlessly integrated into any Ink based animation without any noticeable changes to the application code (other than that it is now animate able!). When it came time to write the Pocket PC port, the majority of the code had to be changed so that it no longer uses the Tablet PC SDK (which was deeply rooted into Ink AniEd), so that it didn’t require any features unavailable in the .NET Compact Framework, to remove dependence on too much floating point arithmetic, to do general performance optimization, but primarily to redesign the interaction model to better suit Pocket PCs. This section will cover my initial work porting the code base over from Ink AniEd, and then how I worked it into a real Pocket PC app.

First of all, let me say that porting C# between .NET and .NET Compact is a breeze; the only major differences was not having the Tablet SDK and the lack of the full GDI+ commands, namely pens with widths other than 1 would have been really nice, and the ability to draw a Point[] polyline instead of polygon. The main idea to carry away is that you take your normal C# code, you drop it into the Compact Framework, you make a few tiny adjustments, and you're done! I’m sure I’ll be porting most of my .NET apps to the Compact Framework now, because it’s just a matter of drag, drop, and move around the controls, and you’ve just put your code “in the hands of your customers”.

The first major difficulty was getting rid of references to the Ink API, which isn’t nice because it meant I couldn’t even compile for a quite a while, and meant I basically rewrote the majority of the code. But all of that was basically just grunt work, nothing too complex (replacing ink events with mouse events, custom drawing and hit detection code etc.). Seriously though, the Ink API is really nice, its rendering mechanism is unbelievably fast, and produces great quality drawing. I highly recommend you try them out sometime. Once that was done, I had a working (albeit crippled) application to work with, and quite frankly, it is a lot easier to work on a project that is up and running than one which you haven’t even seen in action yet. This I see as one of the major cool factors about porting to the Compact Framework, even if your code doesn’t work quite right, or it runs very slowly at first, IT RUNS which is a lot better than many platforms I have ported to before (consider porting from software rendering to hardware rendering, and how long it is before you actually see anything on the screen).

The next issue was floating point arithmetic which is something to seriously keep in mind when developing an app with the concept of porting to PPC in the back of your mind. Floating point math on the PPC is VERY slow compared to integer math (much slower relatively to floating point versus integer math on a normal CPU), so it should be avoided as much as possible when performance is important. While I didn’t completely remove floating point arithmetic from the system, it was kept only on the higher level architectures so that it was used very infrequently, and my testing of the final architecture seemed to show that none of the bottlenecks were floating point related. However, this isn’t something to really worry about as fixed point math is amazingly powerful and easy to use whenever you really get down to it. If you don’t know about fixed point math, basically, it’s a way to represent numbers with decimals using integers and integer math. Look it up on Google. There were also plenty of other little performance issues I changed to reduce GC time and such, but they aren’t of general interest.

One point that I would like to make concerns using DllImport to make calls to QueryPerformanceCounter. This is an effective technique and is also nice for those of us used to using this in Win32. However, there is a major drawback here because it means that your .NET binary will only run on Pocket PCs and not on normal desktops (actually your app only crashes when you call the method not at load time). It was for this reason that I switched over to Environment.TickCount to do my timing. As far as I can see, the animation quality is not noticeably different, and being able to run on a normal desktop is a major plus and definitely worth it.

User interface design was of course the biggest part of development, considering how heavily this application relies on interaction with the user, and how very different the Pocket PC is to more traditional computer systems. One of the interesting issues I first noticed was the lack of a right mouse button, the Tablet PC even has a button mounted on the side of the pen with is usually used to do right click operations and “selection strokes” around multiple objects. So, I landed up removing features like pressure sensitive animations, and adding features like selecting multiple strokes with single taps instead of key-combinations or complex “lasso selections”. All in all, if you try to approach the Pocket PC from as much of a “fresh” perspective as possible then you will probably find development a lot easier.

All in all Pocket AniEd had an interesting development process and I believe created a well rounded tool which will hopefully help to improve pocket interaction and breath some animated life into the static and uninteresting diagrams we find in our day to day lives.

SVG

One of the cooler features of Pocket AniEd is the ability to export your animations as SVG files. SVG is sort of like Flash, except it’s an XML based W3C standard. Which means it’s a lot easier to edit, move around, and integrate into currently existing systems. The files exported by Pocket AniEd can be viewed as animations by themselves or used in larger presentations or web designs. Because SVG is XML based, you can edit it with any text editor (like Notepad) and customize its appearance to your tastes or needs. Take a look at the Pocket AniEd website to see a few examples.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
see http://plaza.ufl.edu/lewey/aboutme.html

Comments and Discussions

 
GeneralI Love it, so do my kids Pin
Paul M21-Jun-04 2:02
Paul M21-Jun-04 2:02 
GeneralRe: I Love it, so do my kids Pin
Lewey Geselowitz21-Jun-04 10:12
Lewey Geselowitz21-Jun-04 10:12 
GeneralVery cool, but like so many other applications... Pin
Member 961-Jun-04 9:24
Member 961-Jun-04 9:24 
GeneralRe: Very cool, but like so many other applications... Pin
Lewey Geselowitz1-Jun-04 11:11
Lewey Geselowitz1-Jun-04 11:11 
Hi John,
I geuss I should address these issues.

As regards the documenation, Pocket AniEd was specifically written to avoid having to have or even have a use for documentation. It was designed so that the average person could quickly pick it up and from a very basic example start animating. When the user needed additional features once they were comfortable with UI, they could quickly find them in an intuitive fashion. While many applications require complete documentation, I felt that it would not be neccasary in this case and would only hinger the user from finding the features for himself thorugh exploration. Remembering features is also easier this way because the feature is conceptually bound to the actions taking place instead of in some predefined order requiring a fair degree of parrot like memorization. In other words, if I may paraphrase many excellent texts, "I leave the detailed usage of this application as an excerise for the reader".

However I do disagree that applications posted on this site should be of "commercial quality". My primary experience with commercial quality programming was during an internship as a Software Design Engineer (programmer) on the Avalon team in Windows "Longhorn". While there I was continuously stunned by the detail and quality of work that Microsoft absolutely requires of all of it's programmers. Thier (and now my) idea of "commercial quality" code means not only does this code perform excellently, but it is runs well under any environment, under rediculous conditions, in different languages, is mindlessly well documented, is designed for parallel development, the formatting has to be just so, and MANY MANY other huge issues, including very importantly maintainability in the future. Each line required design and discussion with team members, near perfectly written code, tons of personal testing, passing multiple tiers of massive batteries of tests, detailed line by line code review by one or more specialists in the area and then it gets really tested! The point is that it is completely impractical for an individual to write applications of such quality in their spare time and completely defeats the point of The Code Project. I personaly love this site because it lets you get to the quick of the application without clouding it in too much junk. From what I've seen of commercial quality code, it is really excellent stuff, but as a reference it is not that great because it clouds the main point of what is tryign to be done in mounds of checking. It's like trying to learn how to adjust a dial by watching a 747 pilot. The applications I would prefer to see on Code Project are "clean" and "purer" focusing on the concept and the point not the details of getting there. This makes the code FAR more readable are thus FAR more useful for people trying to learn from it. For instance compare the different between what happens when a MouseDown occurs in Pocket AniEd to what one might presume happens when it happens in Microsoft Word. I havn't done so, but I imagine that if you read the code in Word it is so complex and integrated that the code would hardly mean anything to you and wouldn't be that useful for just glancing at something, however if you look at Pocket AniEd because I don't have the level of quality that Word does it makes it much easier to see what is happening. Sorry to drift so far there but I wanted to keep Code Project as the clean and direct site that it is. If I and others were to meet the full ".netcf logo" requirements the applications would be alot more complex and I believe harder to read (albeit as an application yes it would be better, but that is not the purpose of Code Project). So in conclusion I believe that professional applications (whose purpose is whatever the application does) should absolutely follow all guildelines, however when an application purpose is education and understanding a more conceptual approach must be taken.

I hope that helps to explain my reasoning in designing this project. And secondly as regards the "File" menu issue, I personally prefer having a file menu and knowing exacly when and how I manage my data. The UI I feel best suits how Pocket AniEd works as a whole, and from my experience with it on my pocket I find it very comfortable. On a personal note however I do find the normal interface used by ".netcf logo" applications a little bit awkward as regards opening/saving and such.

By the way I do appreciate your calling my app cool, and sort of went on a rant above to explain these issues because others have also not understood my reasoning.

-Lewey


Lewey's World: http://plaza.ufl.edu/lewey/
GeneralRe: Very cool, but like so many other applications... Pin
Member 961-Jun-04 13:59
Member 961-Jun-04 13:59 
GeneralRe: Very cool, but like so many other applications... Pin
Lewey Geselowitz1-Jun-04 16:03
Lewey Geselowitz1-Jun-04 16:03 
GeneralRe: Very cool, but like so many other applications... Pin
Member 961-Jun-04 18:05
Member 961-Jun-04 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.