Reputation: 315
I'm programmimg a museum app and I'd like to display a 3D model that responses to the user touches, like pinch to zoom or moving arround the model. I've searched a lot but all I found is game engines that seem very complicated for this thing. Is there any way to import the models (it doesn't matter the format that they have), display it and make it touch responsive? If the code (or the engine) is open source would be better, I'd prefer a free app than a paid app.So many thanks!
Update: right now I'm able to load the 3D model using cocos3D, but as I've said on an answer, the model I can load is very low-ploy. It's an app for a museum and I'd have to be a much more detailed model. I'm using the cocos3D standard template project that shows the animated "hello world", just changed the .pod file to load the one I want and started adding a few modifications to support user touch interaction. I'm reducing about 80% the quantity of original polygons to load it (this is how looks a small part of the model ). If I try to load the model reducing about 50% the original (which looks great, like these ), the app crashes and gives me this log crash:
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'OpenGL ES 1.1 supports only GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE types for vertex indices' * First throw call stack: (0x22cc012 0x1ca9e7e 0x22cbe78 0x173ff35 0x1b550f 0x186751 0x180a81 0x17b750 0x11de32 0x1270d4 0x1263ac 0x14f1a2 0x13ca01 0x14ee02 0x14d45e 0x14d3c2 0x14bb22 0x14a452 0x14efcc 0x14d493 0x14d3c2 0x1643e3 0x162a41 0x10c197 0x10c11d 0x10c098 0x3d79c 0x3d76f 0x85282 0x16e9884 0x16e9737 0x8b56f 0xc4192d 0x1cbd6b0 0x505fc0 0x4fa33c 0x4fa150 0x4780bc 0x479227 0x51bb50 0xbef9ff 0xbf04e1 0xc01315 0xc0224b 0xbf3cf8 0x2fd4df9 0x2fd4ad0 0x2241bf5 0x2241962 0x2272bb6 0x2271f44 0x2271e1b 0xbef7da 0xbf165c 0x1ca506 0x2a55) libc++abi.dylib: terminate called throwing an exception (lldb)
It can't load all the polygons and crashes. Is there any solution for that? Or I must star looking another way to load the model? It you want more information just ask. Thanks.
Upvotes: 3
Views: 1366
Reputation: 69027
I used Cocos3D to import a Earth model and rotate it according to the gestures made by the users. You can give it a look, it's not a complex thing to do.
Have a look at this post for some sample code about loading the model. For handling rotation, I found very useful this post.
Upvotes: 2