Cheetah3D header file converter for iPhone

by Rob Bajorek on May 9, 2009

[Update 2009/06/04: Version 2.0.1 released.  Bug fix release, see here for more information.]

It’s ready!  The promised Cheetah3D -> iPhone header converter is right here:

c3d_to_iphone_h.pl (zipped)

With this program you can convert exported Cheetah3D OpenGL .h files to an iPhone-compatible format.

Please read the comments at the top of the program file for usage information.  I tested this on Mac OS X 10.5.6, but it should work on any system with Perl 5.  I purposely did not use any external modules (no messing with CPAN here.)

The software is free, licensed under GPL 3.  If you try it, please send feedback or respond in the comments.  Thanks!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • Slashdot
  • StumbleUpon

{ 8 comments… read them below or add one }

1 Roger May 11, 2009 at 11:45 am

Hi,
thank you very much for publishing the perl-script. Have you also tried to optimize it for using VBOs?

Reply

2 Rob Bajorek May 12, 2009 at 1:56 am

Hi Roger,

I didn’t add support for VBOs because the performance benefit isn’t clear. On iPhone, VBO functions don’t store data in the graphics hardware; the program will still copy from “client” side every draw. Kevin Doolan has a good post about it. There’s more discussion about it on Apple’s iPhone developer forum (paid developer account required). And from my personal experience, converting a project to use VBOs ran about the same.

I’m not planning on VBO support unless Apple fixes their implementation (if that’s possible; it might be a hardware limitation.) That said, if someone sent me a VBO patch for the converter anyway, I’d certainly add it as an option.

Reply

3 Scott June 4, 2009 at 11:53 am

Excellent script, thanks. It is the last tool I needed to start working on my app.

Just some feedback to save others some time. I used your script on a sphere and it worked fine. However when I tried it on a more complicated object, it failed. The object was created using boolean operations in Cheetah. Cheetah used names beginning with Boolean.1 in the exported .h file. When I globally replaced Boolean.1 with Boolean1 in the .h file, the script worked like charm.

Again, thanks for the script. The prospect of learning Blender was depressing at best. LOL

Reply

4 Rob Bajorek June 4, 2009 at 1:52 pm

Hi Scott,

Thanks for the feedback! I’m glad you’re finding the converter useful and could work around that ‘.’ problem. I’ll post an update later today that handles that and other C3D->Obj C naming issues automatically.

Reply

5 CR June 13, 2009 at 2:09 pm

I’m so happy about finding this little bit of code I’m about ready to curl up and cry in a corner…

Seriously, thanks! This thing has just made dealing with model creation on the iPhone so much easier for a newcomer to OpenGL like me.

Reply

6 Rob Bajorek July 7, 2009 at 10:59 pm

Thanks for the kind words! I hope the converter has made learning OpenGL more fun for you.

Reply

7 Mike September 10, 2009 at 11:38 pm

I was so excited when I found this posting but I haven’t had much luck. I have tried 3 different models and they all seem to be transparent looking. Maybe the windings are reversed?

Here is a screenshot: http://www.knert.com/cms/images/model.png

Reply

8 Mike September 11, 2009 at 12:29 am

Nevermind. I’m a noob. I had the depth buffer turned off. Everything looks good!

Reply

Leave a Comment

Powered by WP Hashcash

{ 1 trackback }

Previous post:

Next post: