你好家伙: 我必须在将它们绘制在一个框架上之前投射很多点。 我的代码是打击:如何使矩阵计算更快?
-(Coordination*)xyWorldToDev:(Coordination*)pt isIphoneYAxis:(BOOL)isIphoneYAxis{
CGPoint tmpPoint=CGPointApplyAffineTransform(CGPointMake(pt.x,pt.y),worldToDevMatrix);
Coordination *resultPoint=[[[Coordination alloc]initWithXY:tmpPoint.x withY:(isIphoneYAxis)?(sscy-tmpPoint.y):tmpPoint.y]autorelease];
return resultPoint; }
-(Coordination*)xyDevTo3D:(Coordination*)cPt{
double x=0.0,y=0.0;
double divide=1+m_cView3DPara.v*cPt.y;
x=(m_cView3DPara.a*cPt.x+m_cView3DPara.b*cPt.y+m_cView3DPara.e)/divide;
y=(m_cView3DPara.d*cPt.y+m_cView3DPara.f)/divide;
return [[[Coordination alloc]initWithXY:x withY:sscy-y]autorelease];
}
-(Coordination*)transformWorldTo3D:(Coordination*)pt{
return [self xyDevTo3D:[self xyWorldToDev:pt isIphoneYAxis:NO]];
}
因此,该方法 “ - (协调*)transformWorldTo3D:(协调*)PT” 被称为几百倍,因为突出。
但我发现它是非常非常慢,而调用transformWorldTo3D! 有没有另一种方法来加速它?或者使用另一个可以更快计算投影值的框架?
你能添加调用transformWorldTo3D – Manny 2010-10-28 03:44:07