Dragging, scaling, and rotating objects using multi-touch
In this recipe, we will learn how to create objects responsible to multi-touch gestures, such as dragging, scaling, or rotating by extending the InteractiveObject
class mentioned in the Creating an interactive object that responds to the mouse recipe of this chapter. We are going to build an iOS application that uses iOS device multi-touch capabilities.
Getting ready
Please refer to the Creating an interactive object that responds to the mouse recipe to find the InteractiveObject
class headers and source code and Creating a project for an iOS touch application recipe from Chapter 1.
How to do it…
We will create an iPhone application with sample objects that can be dragged, scaled, or rotated.
Add a new header file named
TouchInteractiveObject.h
to your project:#pragma once #include "cinder/app/AppNative.h" #include "cinder/gl/gl.h" #include "cinder/Color.h" #include "InteractiveObject.h" using namespace std; using namespace ci; using...