views:

53

answers:

3

I come from 3D animation and one of the basic things all 3D software have is the ability to create dummy objects. Dummy objects can be used to groups objects that can be rotated, moved or scaled together around a specific anchor point. This is the idea of what I am asking.

Obviously we can have fake dummies by using a view and put other views as subviews, but this has problems as the view receives clicks and sometimes you don't want it to do so. You cannot change the anchorpoint of a view too.

So, the dummies as I ask have, at least, these properties:

  1. adjustable anchor point
  2. it is not clickable
  3. it is totally invisible (cannot be rendered).
  4. any scale, rotation and translation of a dummy are propagated to the grouped objects considering the dummy's anchor point.
  5. it is totally animatable.

Can this be simulated on iPhone? Is there any object that can be created to simulate this? thanks.

A: 

Have a look at CATransformLayer.

Ole Begemann
+1  A: 

Working in OpenGL you can create classes that do just this, basically you end up with nested transforms.

Any of the 3D engines I've seen also support this out of the box.

jessecurry
no way to do that without using OpenGL?
Digital Robot
Well, it's really not so much a function of OpenGL as it is a function of your display code; it just so happens that most of the display code used by 3D engines supports what you're looking for.The CATransformLayers that Ole Begemann pointed out might help, but standard UIView hierarchies are meant for display and input, so you'll always have to deal with touch events in one way or another. If you need a 3D engine, take a look at sio2 - http://sio2interactive.com/
jessecurry
A: 

CALayers have anchorPoints… And they're animatable. I think that's what you're looking for — they're a lot like sprites.

David Dunham
And every UIView is a thin layer around a CALayer.
Kendall Helmstetter Gelner