Question

I have an NSString which is splitted into set of characters.

I need to render these set as a cloud of characters and:

  • characters must be placed in 3D
  • characters must have random rotation and scale
  • different fonts can be used

The proper way is to use OpenGLES framework. Please advice some samples, examples or direction to start.

Was it helpful?

Solution

Render the characters as textures on quads. Then you can manipulate them in 3D to your heart's desire...

See: This question/answer for some more details.

OTHER TIPS

You say that OpenGL ES is the "proper way to do this", but I would suggest looking at Core Animation for this kind of a task. You can easily create a series of UILabels, one for each character in your cloud, with random fonts assigned to the labels. You would need to place these UILabels within a subview, and assign them a 3-D location using the position and zPosition properties of the UILabel's layer. A random rotation and / or scaling in 3-D can be applied using CATransform3DRotate() or CATransform3DScale(). An example of the kind of 3-D manipulations you can do to CALayers can be found here.

Using Core Animation for this task will require far less code than pure OpenGL ES, because you won't have to manage the manual text drawing yourself, and Core Animation handles all of the 3-D rendering for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top