Page 1 of 1

quartz composition

PostPosted: Sat Jun 02, 2012 1:18 pm
by udo.killermann
Board,

I was playing around with Quartz Composer (found in the Developer Tools) recently and trying to get it work with Obj B. In a book I was reading, the author stated you can use Quartz composition as visualization to enrich the user interface. But with QCViewer you have the ability to control the composition via your program:

Code: Select all
Event AwakeFromNib()
'  Log(theQCView.loadCompositionFromFile("/Users/HU/Desktop/ObjectiveBasic/quartz composition/helloWorld2.qtz"))
  Log(theQCView.loadCompositionFromFile(NSBundle.ResourcePath() & "/helloWorld2.qtz"))
  theQCComposition = theQCView.loadedComposition()
  Log(theQCComposition)
  Log(theQCComposition.inputKeys())
  Log(theQCView.valueForInputKey("backColor"))
 Log(theQCView.setValue(LightGrayColor, forInputKey := "backColor"))
 Log(theQCView.setValue(NSBundle.ResourcePath() & "/humble bee.JPG", forInputKey := "imageLocation"))
  theQCView.setValue(theYKnob.SingleValue, forInputKey := "yRotation")
  theQCView.setValue(theXKnob.SingleValue, forInputKey := "xRotation")
  theQCView.setValue(theZKnob.SingleValue, forInputKey := "zRotation") 
End Event


The result looks like this:
clock.jpg
clock.jpg (38.96 KiB) Viewed 1196 times


It's not static, but really ticking away the seconds while you watch it (so give it a run on your computer). Behind the digits you can see a background image shining through. You can easily change this to something more suitable for you by modifying the imageLocation key. If you move the dials you can tilt the digits around x-,y- and z-axis respectively.

Here comes the project:
quartzComposer.zip
(1.99 MiB) Downloaded 158 times


The heavy lifting is done in helloWorld2.qtz, which looks like this in Quartz Composer:
composerFlow.jpg
composerFlow.jpg (66.36 KiB) Viewed 1196 times


I would like to read from you if it works on your computer as well.

Regards
Udo