Donnerstag, 24. Juli 2014

Scene Kit dragging / picking demo for OS X / iOS

I just published this little demo of Scene Kit, where we can drag around a 3d model and select individual parts. For OS X and iOS using Swift.




The code in probably self explanatory (if not, I'm sorry...). The 3d program needs to give each object a name, which we use to identify what we picked - in the case of this example, we use it to show the label at the bottom "Right foot" etc. The model has to be exported to .dae.

In Blender the name of the object is here:





Code:

OS X:
https://github.com/i-schuetz/scene_kit_pick

iOS:
https://github.com/i-schuetz/scene_kit_pick_ios

The iOS version is laggy, at least in the simulator, don't think it's related with the code or my super complex 3d model ;). It might be a bug of the beta.

Donnerstag, 3. Juli 2014

Items drag & drop iOS exercise

This is a little exercise I did to practice gesture recognizers, collection view, and snapping effect effect using UIDynamicAnimator (iOS 7).
We can drag and drop views from the bottom selector to top view. The views can be clicked to see more info. When view is dragged to invalid place it snaps back. Placed views can be removed by dragging back to the bottom.
This can be useful for e.g. placing furniture in a room, dressing a person, etc.
It needs refactoring, right now everything is in a view controller.


Code