Archive for the 'Graphics' Category

My video editor of choice? Quicktime Player (Pro).

February 29th, 2008
Spencer Nielsen Follow snielsen42 on Twitter

I must say that over the years more than any other video editing program I have used Quicktime Player (editing functionality requires Quicktime Pro) to do quick, clean and simple edits of video when I have needed to. Despite having only limited editing functionality and its purpose isn’t primarily to edit video, I have found that it gets the jobs I want done without a lot of hassle and helps maintain my video file fidelity.

I havn’t had the time to learn Final Cut Pro and for most jobs that I want to accomplish it feels a little overqualified. iMovie tends to mush my video around in ways that I don’t like such as transcoding it into something else, messing with the video dimensions and framerate. There may be better alternatives closer to what I want but I am not aware of them and I havn’t hunted extensively.

What I like about Quicktime Player is that I can slice and dice, re-order things, make translucent overlays and muck with the soundtrack by simply adding in references (by copy/paste) to my source media and then play with them. This means that nothing has to re-render and everything stays quality (the big box editors of course do this too). Now there are some problems sometimes when you try to play things back. Often my edits would playback one frame off as it is trying to load the resource or something. Even when I save the movie as a self contained archive it seems to have this problem. However, I have found that when I am all done with my edits simply choosing to “Export->Movie to Quicktime Movie” seems to take care of that.

An example of using Quicktime Pro to add a translucent comment overlay onto a video:

qteditor

  •  First I make a translucent png the same size as my video.
  •  The I open it with Quicktime Player
  •  Edit->Select All
  •  Edit->Copy
  •  Then I open my video and select the time that I want that overlay to be visible
  •  Edit->Add to Selection & Scale
  •  Window->Show Movie Properties
  •  I then change the new video track’s “Transparency” to “Straight Alpha”.
  •  Lastly I make sure to export so that the little transition jitters are removed.

It seems to have filled my little niche fairly well. Perhaps one day my needs will grow but until then Quicktime Player will be my quick and clean tool of choice.

Physics Models

December 20th, 2007
Spencer Nielsen Follow snielsen42 on Twitter

So I have been thinking about what level of physics model I want to implement in Razor. Specifically I have been doing a lot of thinking about collision detection. There are a lot of different ways of doing things with their own strengths and drawbacks. I have initially made the decision of going for more precision and complexity versus speed and ease of computation. I have been spending a lot of time at Wolfram Mathworld trying to remember all the stuff I learned in college.

In preparation for the impending physics tests I have added optional bounding box drawing to all the Actor objects:

Razor Bounding Boxes

I looked around and didn’t immediately see any optimized math libraries that calculate determinants on the mac. If anybody knows of one please let me know. I did find this thread which had some helpful ways of doing it manually.

Why is it called Razor? I don’t know, I just needed a name.

December 18th, 2007
Spencer Nielsen Follow snielsen42 on Twitter

I actually had a very hard time thinking of a name for this project. Nothing really seemed to fit too well or sound that good. But I needed some sort of name for my new project. You have to call it something… I finally settled on “Razor”. What does it mean? Nothing. What does it have to do with the project? Nothing other than now that is what the project will be known by. After not being able to think of a name for a while and itching to just start coding on the darn thing I just picked the name and it has just kind of settled.

Ok, so what is it? On the Google Code page that it is hosted at I wrote:

Razor is a strategy game engine which is oriented around programming the AI of the units rather than direct control by humans. The idea is that human players compete by engineering the intelligence of the units under their control in order to fulfill an objective. The game world is in 3D and will employ some basic physics. Units, AI, physics models and many other aspects are extensible through a plugin system.

Razor is for Mac OS X Leopard only due to leverage of certain Leopard exclusive features such as dynamic loading/unloading of Objective-C, Garbage Collection and more as time goes on.

This is an idea I have had banging around in my head for a long time. Ever since I worked on an AI lab in college where the final semester objective was to program the AI of 5 tanks to play capture the flag against 5 other tanks controlled by one of the AIs of my many classmates. At the end of the semester the class had a tournament in which the prize was an instant ‘A’ in the class and didn’t have to take the final! My lab partner and I won the tournament and even though we both had As in the class at that point, not having to take the final exam was a big time relief at the end of a very busy semester. Perhaps I will make a blog post on our winning strategy later.

Along with that, I have always loved the great strategy involved in RTS games like Starcraft (which in my opinion is the best RTS ever made). I loved thinking of crazy new strategies that would find kinks in established defenses or play with the psychology of the other players. The only thing that prevented me from pulling off my grand designs was the limitations of my own reflexes. Some people just have the twitch and can bounce from scene to scene, keep everything in their heads at once and make lightning fast and precise mouse movements. But if the Korean Starcraft scene is any indicator, these cyber-athletes like gymnasts have a limited lifespan. Once you hit the ripe old age of 22 your reflexes aren’t what they used to be and some pretty young 16 year old is going to take your spot. What I want in some respects is AI programmable Starcraft.

Now the project is only in its infancy and is nowhere near doing anything of significant interest at this point but I decided that I wanted to get the code into an initial functional state that would at least be worthy of initial check-in. Because the project is open source I will be commenting here about the work that I am doing on it, future feature additions and other issues with great openness and frequency unlike my closed projects.

Below is a screenshot of the Simulation Viewer app that you can build and run right now from the source that is posted on the project page. It is not much but it is a start.

Razor, first commit

Digital Quoteboard

August 18th, 2007
Spencer Nielsen Follow snielsen42 on Twitter

So one idea that I have had knocking around in my head for a while has been a digital quoteboard. I remember how in college I would go over to somebody’s apartment and there would be this quoteboard full of funny one-liners which if taken of context or more often, taken in the context of who said them, were hilarious. Of course they are usually only funny if you knew the people that said them. I thought about how there are a lot of online communities of tight knit people who could have a little bit of fun with a digital equivalent and so I whipped up this little example. I will probably refine it here and there over time and will probably release the source soon (it is not that much code). Other things I have thought of were live javascript based editing and WordPress permissions hook ins. It currently works by having a php page render a csv quote database into a jpg so you can have static links to the results, ensuring that it will work in every browser (the above image is the actual linked image and thus may change as the database changes). So far what I have found is that there is a great disparity in exact results or even basic functionality in using the same Truetype font on different operating systems and different versions of the graphics libraries that PHP hooks into. Also, it appears that some fonts do not fully define things like punctuation and formating such as tabs. Feel free to leave a quote by going here. Although I may decide to remove general access to it in the future 😉

The Biggest Graphics Problem You Have Never Heard Of

July 15th, 2006
Spencer Nielsen Follow snielsen42 on Twitter
OpenGL

I am now pleased to announce the second of many tech oriented articles that will be placed here on the Blue Lotus Blog. This time it is about a problem in computer graphics that I have been working on for years called Order Independent Translucency. It is something so simple and basic that you might wonder why nobody has solved it. So have I. That is why I have decided to write about it and have included some example source code to go with it. In this article I outline the problem, discuss and implement the currently most promising solution and suggest a better hardware-based solution. Come on in and let us make you aware of a problem that you were happy to be oblivious to.

Entries (RSS) and Comments (RSS).