Awesome
UPDATE
After finishing this try-out project I made Flappy bird colne with Metal, go check it out https://github.com/haawa799/Metal-Flaps
METAL_Playground
Task: Create complex 3D scene app using Apples new Metal framework, using Swift as much as possible.
NOTE1: Since I'm trying to use Swift where it's posiible, this code is not super efficient or fast, there are some wrappers which are not recommanded in this kind of projects.
Hope to improve it as new Xcode betas will come out.
NOTE:
-
For now (Xcode 6 - beta2) requires -Ofast compiler flag to build.
-
iOS 8 and device with A7 required! Doesn't work on simulator.
Model importing script Obj_Convert.py
In part 5 i wrote simple python script which parse OBJ file (generated from Blender or any other 3D model tool) and produce Swift class and txt file.
Here are steps on how I used it to get that Ram rendered. Here's a link to free 3D model http://www.3dvia.com/models/67EC495D6F415365/ramiro-the-ram, thanks to dipsy.
-
Put your OBJ and MTL file (generated from Blender) into one folder
-
Make sure that both OBJ and MTL files have same name, and this name will be your Swift class name, in my case it's "ram.obj" and "ram.mtl"
-
Put Obj_Convert.py file into same folder
-
From terminal cd to your folder
-
Run following command "python Obj_Convert.py name" name should be equal to .obj and .mtl file names in my case it's "ram"
-
Check you folder, .swift and .txt files should be there, drag and drop them into your project
-
Double check .swift file, wethere texture name is correct
-
Use imported model as any other Model subclass inside your MetalViewController