1
如果我變換到NSView
可可的應用程序:爲什麼CATransform3DMakeRotation在繞Z軸旋轉時不能取(0,0,1)?
self.view.layer.transform = CATransform3DMakeRotation(30 * M_PI/180, 0, 0, 1);
我看到周圍的Z軸不旋轉的正方形,但旋轉,如果該矢量被向下並向外指向。我需要讓
self.view.layer.transform = CATransform3DMakeRotation(30 * M_PI/180, 1, 1, 1);
讓它繞Z軸,如圖所示畫面上this question。
然而,如果我設置在update
方法的NSTimer
,然後更新transform
,然後使用
-(void) update:(id) info {
self.view.layer.transform =
CATransform3DMakeRotation(self.degree * M_PI/180, 0, 0, 1);
self.degree += 10;
}
(此時,利用(0, 0, 1)
)將工作:它繞Z軸。我想知道爲什麼applicationDidFinishLaunching
裏面需要(1, 1, 1)
,但是(0, 0, 1)
可以用在update
的方法中嗎?