298 // Therefore the order of the transformations matters. |
298 // Therefore the order of the transformations matters. |
299 // In order to prevent the scaling ang skewing from affecting the translation, |
299 // In order to prevent the scaling ang skewing from affecting the translation, |
300 // if seems wiser to do the translation first, otherwise the results seem to be unpredictable. |
300 // if seems wiser to do the translation first, otherwise the results seem to be unpredictable. |
301 |
301 |
302 // Translation |
302 // Translation |
303 if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f) |
303 TReal32 translationX = 0.0f; |
304 { |
304 TReal32 translationY = 0.0f; |
305 aGc.Translate(EHuiGcMatrixModel, iTranslationX, iTranslationY, iTranslationZ); |
305 TReal32 translationZ = 0.0f; |
|
306 |
|
307 if (iTranslationX != 0.0f) |
|
308 { |
|
309 translationX = iTranslationX - iVisual->EffectDisplayRect().iTl.iX; |
|
310 } |
|
311 if (iTranslationY != 0.0f) |
|
312 { |
|
313 translationY = iTranslationY - iVisual->EffectDisplayRect().iTl.iY; |
306 } |
314 } |
|
315 |
|
316 if (iTranslationZ != 0.0f) |
|
317 { |
|
318 // Z translation not supported by the model |
|
319 translationZ = iTranslationZ; |
|
320 } |
|
321 |
|
322 if (translationX != 0.0f || translationY != 0.0f || translationZ != 0.0f) |
|
323 { |
|
324 aGc.Translate(EHuiGcMatrixModel, translationX, translationY, translationZ); |
|
325 } |
307 |
326 |
308 // Scaling |
327 // Scaling |
309 if (iScaleX != 1.0f || iScaleY != 1.0f || iScaleZ != 1.0f) |
328 if (iScaleX != 1.0f || iScaleY != 1.0f || iScaleZ != 1.0f) |
310 { |
329 { |
311 if ( iScaleOriginX != 0 || iScaleOriginY != 0 || iScaleOriginZ != 0 ) |
330 if ( iScaleOriginX != 0 || iScaleOriginY != 0 || iScaleOriginZ != 0 ) |