January 6th, 2009 — 10:21am
I love that part in Aliens II when Sigourney Weaver says, “We are going to need a bigger boat.” And then she tries to shoot the land shark with her rail gun.
Cocoa plists are converted from XML to an easily-parsed binary format when they are deployed. I think it may not be a dumb idea to try and convert a 3D model in COLLADA format to plist. One alternative is to somehow convert the 3D model to a giant static array. Another might be to use a different file format. The case for COLLADA/plist conversion is based on the idea that they are both XML so a style sheet can be used to do the conversion and that plists are efficient and native to Cocoa.
The first issue is memory. The iPhone does not have a lot and applications have only a little bit (about 20Mb). Assuming a giant 3D model, I am guessing that a program will not even start that tries to load its verticies, etc. from static arrays. I am sure it is possible to write a really engaging application that uses static arrays. However, I’d rather go into a project with the idea that you are going to use only the amount of memory that you need to be using right at that moment.
For example, you don’t need to load up the 3D model of the Boss Alien-Life Land Shark character (composed of 130,000 triangles) until you are going to show the Boss Alien-Life Land Shark character. So why carry BALLS around the whole time in a static array?
The next issue is efficiency. Any kind of file used to provide an application with 3D model information has to be parsed. You could probably just provide an applicaiton with one of the dozens of formats that a modeling tool will export and then parse it. If you use a plist, parsing is done for you by Cocoa (or something beneath Cocoa). The most efficient thing, of course, is just to use static arrays. A static array uses stack memory (very efficient) and needs no parsing.
I have got the COLLADA/plist solution working as a proof of concept. I will clean it up a bit and post here this week.
Next time: Aliens III: The Code
Comment » | 3D, iPhone Programming
January 1st, 2009 — 2:11pm
My New Year’s resolution is to not backfill my music collection any more.
I just bought The Duke Spirit and Ponytail’s latest albums. I had Bad Religion’s Stranger Than Fiction in my shopping cart to replace the one I lost a few years ago. Then, I yanked it out because it would be really bad form to break your NYR on January 1.
Comment » | Uncategorized
December 29th, 2008 — 2:09pm
I found this new “web site” on the Internet yesterday. If you would like to check it out yourself, the URI is http://www.facebook.com. Apparently, the idea is to make virtual friends and to expand your “social network”.
I think these guys are on to something.
Previously, I thought I was too old for Facebook. It turns out, there are people even older than me friending, etc. I can’t wait to get back in touch with all my Snobson High friends again so they can give me virtual wedgies in the locker room. I will reciprocate by virtually looking down and muttering to myself. Maybe I’ll be allowed to enter the virtual smoking area for some quality time with the stoners.
For me, Facebook is a healthy dose of fresh shame. Next week: MySpace.
Comment » | Har de Har
December 24th, 2008 — 2:23pm
2 comments » | Har de Har
December 23rd, 2008 — 12:51pm
Comment » | Har de Har
December 10th, 2008 — 3:15pm
Someday, alien archeologists will look back at my blog and marvel at what a dipshit I was. Yep, good times.
I am writing an xml style sheet that transforms a COLLADA description of a 3D model into Apple plist XML. I can then write an Objective-C utility class that factories all my OpenGL geometry. This makes me feel less depressed about aliens from the future mocking me.
Comment » | 3D, iPhone Programming
December 3rd, 2008 — 4:45pm
Comment » | Har de Har
December 2nd, 2008 — 8:00pm
Unbelievably, I think I am on the right track with my 3D application development workflow. I can’t believe people actually write software like this! It seems so archaic and inelegant. You literally need to list all the vertices for every 3D object in your program. There seems to be a minimum of three different parts: your wireframe (or vertices), “normals” that help define curved surfaces, and textures.
1 comment » | 3D, Business
December 1st, 2008 — 8:24pm
I am beginning to do some 3D game programming for the iPhone.
The iPhone uses the OpenGL ES platform for 3D graphics. It works across most other operating systems and graphics hardware implementations. The API has a little learning curve and, it seems, enough subtleties to drive people a little nuts. The hardest part seems to be coming up with all the little virticies that make up your 3D model.
I can’t be sure yet, but I think many people use modeling tools like Maya for the purpose of 3D modeling. Maya is very expensive (thousands of dollars.) Blender seems to do the same thing and is open source. I plugged in a Python script for saving my Blender model as a header file and I nearly had a workflow for writing 3D games for the iPhone.
Tomorrow, I am going to an iPhone developer mini-conference hosted by Apple. I’ll get the real scoop and report back…
Comment » | Business, iPhone Programming