Sorry for the lack of posts recently. Things have been, well… you know. Same old story. Super busy. Which is good, but it's murder on blog post frequency.
I've recently had to port some OpenGL ES work I did from iOS to Android. It used to be that doing so would have been insanely painful (as opposed to just painful). I would have had to convert the Objective-C code to Java, and then maintain completely distinct sets of code that do the same exact thing. Fortunately, the Android NDK (Native Development Kit) allows you to write code for Android in C/C++. The version of the NDK supported on 2.2 still requires part of the Activity (Android's counterpart to an iOS view controller) to be written in Java, but does allow you to call C/C++ code using JNI. In 2.3 and 3.0, you can do entire activities in C or C++.
This is a huge step forward for Android for those of us who do performance-critical work on multiple platforms, but it's not without some pain. Debugging across the JNI bridge is… less than easy. But, being able to share code across platforms is a huge win, and being able to get native speeds in the process is teh awseome.
During these projects, I've been taking a lot of my 3D-related code and creating a new set of platform-agnostic C functions and types. I've been cleaning up and making names consistent, and placing appropriate pre-compiler macros to make sure the code compiles correctly everywhere. On iOS, the library will take advantage of the Accelerate Framework in places, but doesn't require Accelerate to function.
I've chosen C because I don't like mixing C++ and Objective-C. The object models are too different for my tastes. But I've also made sure to include proper ifdef'd extern statements so that you can import the MC3D header files from C++ without hassle.
I've dubbed this set of functions MC3D, and I'm making it open source under a simplified version of the simplified BSD license (simplified simplified BSD license?). I've taken out the attribution requirement, so the only requirement is that if you re-distribute the source code, you have to leave the copyright and license text intact. That's it. Otherwise, you can use it for free in any project, commercial or otherwise, without paying anything, without attributing, and without asking (no really, you don't need to ask).
MC3D is still very much a work in progress, and I'm only adding code to the repository that I feel is ready for public consumption. Much of what's in MC3D has been posted here before, sometimes with different names or in slightly different form.
I have other code that I plan to add in the future, including higher-level functionality like model loading, scene management, and skeletal animation, but I won't add anything until its both solid and platform agnostic.
Currently, documentation is very sparse, and I currently can't offer any support or help with using it, so caveat emptor! I will gladly accept contributions, bug fixes, and new functionality back into the MC3D codeline.
MC3D on GitHub.
Link fixed, sorry about that
Page
Photos on Flickr
Categories
- 128*128 (5)
- 128*160 (7)
- 128x128 (5)
- 128x160 (7)
- 176*208 (5)
- 176*220 (8)
- 176x208 (5)
- 176x220 (8)
- 240*320 (20)
- 240x320 (20)
- 320*240 (2)
- 320x240 (2)
- 352*416 (1)
- 352x416 (1)
- 360*640 (1)
- 360x640 (1)
- 3D (2)
- android (18)
- android market (4)
- Animation (1)
- App Store (3)
- Apple (22)
- Apple HQ (1)
- appps (1)
- apps (34)
- Appsterdam (1)
- att (1)
- autocomplete (1)
- Automobile (1)
- beta labs (1)
- BlackBerry (1)
- Blender (2)
- blogger (1)
- Book project (2)
- Cannonball 8000 (1)
- card (2)
- Caveman Cricket (1)
- cfw (1)
- CGAffineTransform (2)
- Circus Extreme Turbo Camels (2)
- Combat Club 3D (1)
- Community (1)
- conferences (10)
- Core Animation (1)
- cricket (1)
- Docs (2)
- download (20)
- Driving (1)
- ebook (1)
- Exercise (1)
- facebook (2)
- Firmware (1)
- Flash (1)
- flashlite (1)
- Flatout3D (1)
- Football (1)
- france (1)
- free (20)
- free code (1)
- Fruit Ninja (1)
- game (21)
- Game development (1)
- Game Programming (2)
- germany (1)
- GLKit (1)
- gmail (1)
- gmail for mobile (1)
- google (5)
- google apps for mobile (1)
- google docs (3)
- google earth (1)
- google goggles (4)
- Google I/O (1)
- google latitude (1)
- google local search (1)
- google maps (2)
- google maps for mobile (8)
- google maps navigation (2)
- Google Mobile Search (1)
- google offers (2)
- google search (3)
- google search app (1)
- google search by voice (1)
- google search for mobile (5)
- google shopper (2)
- google sites (1)
- google sync (1)
- google translate (2)
- google voice (1)
- google wallet (3)
- google+ (1)
- googlenew (15)
- Graphics Programming (1)
- hangouts (1)
- Harry Potter And The Deathly Hallows Part 1 (1)
- iBooks (1)
- image search (2)
- inside search (1)
- iOS (6)
- iOS SDK (2)
- ipad (4)
- iphone (8)
- iPhone 4s (2)
- iPhone SDK (4)
- ipod touch (1)
- italy (1)
- jad (20)
- jar (20)
- java (20)
- Lost Planet 2 (1)
- Lux Drops Of Beauty (1)
- Mac App Store (1)
- Mac OS X (1)
- MacBook Air (1)
- Madagascar 2 Escape To Africa (1)
- MartianCraft (1)
- MIsc (1)
- mobile (23)
- movies (1)
- New Category (1)
- news (30)
- nexus (2)
- nfc (1)
- Nokia (30)
- nokia software (1)
- nokia store (1)
- Nowhere (1)
- Objective-C (3)
- Ohter Blogs (1)
- Oil (1)
- Open Source (3)
- OpenGL ES (10)
- Other blogs (7)
- ovi (1)
- Pilgrimage (6)
- Place Pages for mobile (1)
- Places (1)
- poker (1)
- Puzzlings (1)
- qt (12)
- Rant (7)
- review (1)
- Rounders Poker (1)
- Sample Code (4)
- Security (5)
- Sensible Soccer Skills (1)
- Software Development (1)
- Sola Rola (1)
- Solitaire Deluxe Jamdat (1)
- source code (1)
- spain (1)
- Speaking (2)
- sport (2)
- sprint (1)
- Steve Jobs (2)
- tablet (4)
- The Difference Spot (1)
- themes (2)
- Tips (1)
- Tokio Hotel The Official Mobile Game (1)
- transit (2)
- Treadmill Desk (2)
- tutorials (1)
- twitter (1)
- ui (1)
- uk (1)
- voice actions (1)
- voice search (1)
- WWDC (12)
- Xcode (1)
- Xcode 4 (3)
0 comments