Skip to content

Commit 227bb60

Browse files
Version 5.17.1. vtkTransformHelper class: Pre/PostMultiply fix for intrinsic transformations. (#22)
Co-authored-by: Charles PIGNEROL <>
1 parent 6b8dab7 commit 227bb60

4 files changed

Lines changed: 29 additions & 14 deletions

File tree

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set (VTK_CONTRIB_MAJOR_VERSION "5")
66
set (VTK_CONTRIB_MINOR_VERSION "17")
7-
set (VTK_CONTRIB_RELEASE_VERSION "0")
7+
set (VTK_CONTRIB_RELEASE_VERSION "1")
88
set (VTK_CONTRIB_VERSION ${VTK_CONTRIB_MAJOR_VERSION}.${VTK_CONTRIB_MINOR_VERSION}.${VTK_CONTRIB_RELEASE_VERSION})
99

1010

src/VtkContrib/public/VtkContrib/vtkTransformHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class vtkTransformHelper
3737
* Classe créée à la base pour pouvoir, à partir d'une instance de cette classe conservée par exemple dans une IHM, recréer une instance de
3838
* vtkTransform à partir de la méthode vtkTransformHelper::CreateTransform (vtkSimpleTransformMemento).
3939
*
40-
* Une transformation intrinsèque est nue transformation géométrique qui est appliquée directement à un objet ou à un système de coordonnées
40+
* Une transformation intrinsèque est une transformation géométrique qui est appliquée directement à un objet ou à un système de coordonnées
4141
* dans son propre repère. Contrairement aux transformations extrinsèques, qui sont appliquées par rapport à un repère externe, les
4242
* transformations intrinsèques modifient les propriétés internes de l'objet ou du repère lui-même (position, orientation, forme, taille).
4343
*
@@ -62,7 +62,7 @@ class vtkTransformHelper
6262
// Les éventuelles mises à l'échelle. Effectuées avant toute autre opération.
6363
double scaleX, scaleY, scaleZ;
6464

65-
// Paramétrage transformation extrinsèque :
65+
// Paramétrage transformation extrinsèque/intrinsèque :
6666
double xoy, xoz, yoz; // theta, phi, omega
6767
double dx, dy, dz;
6868
bool translationFirst;

src/VtkContrib/vtkTransformHelper.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,37 @@ vtkTransform* vtkTransformHelper::CreateTransform (const vtkTransformHelper::vtk
135135

136136
if (true == memento.isExtrinsic)
137137
{
138-
if (false == memento.translationFirst)
138+
// Passage en mode PostMultiply pour le repère extrinsèque (global)
139+
transform->PostMultiply ( );
140+
141+
// Application des transformations dans l'ordre exact de l'énoncé
142+
if (true == memento.translationFirst)
139143
transform->Translate (memento.dx, memento.dy, memento.dz);
140-
transform->RotateY (memento.xoz);
141-
transform->RotateX (memento.yoz);
144+
145+
// Rotations autour de Oz, puis Oz, puis Oy :
142146
transform->RotateZ (memento.xoy);
143-
if (true == memento.translationFirst)
147+
transform->RotateX (memento.yoz);
148+
transform->RotateY (memento.xoz);
149+
150+
if (false == memento.translationFirst)
144151
transform->Translate (memento.dx, memento.dy, memento.dz);
145152
} // if (true == memento.isExtrinsic)
146153
else
147154
{
155+
// Passage en mode PreMultiply pour le repère intrinsèque (local)
156+
transform->PreMultiply ( );
157+
158+
// Application des transformations dans l'ordre exact de l'énoncé
148159
if (true == memento.translationFirst)
149160
transform->Translate (memento.dx, memento.dy, memento.dz);
150-
// RotateY(phi) → RotateZ(theta) → RotateX(omega) : chaque rotation s’applique dans le repère local courant,
151-
// méthode standard pour les angles de Tait-Bryan intrinsèques (ZYX) en robotique/aéronautique. Dixit mistral.ai.
152-
// Pour ce il faut inverser l'ordre des rotations par rapport à la même transformation mais à repère constant
153-
// (transformation extrinsèque).
154-
transform->RotateX (memento.yoz);
155-
transform->RotateZ (memento.xoy);
161+
162+
// Rotations autour de Oy, puis Oz, puis Ox :
156163
transform->RotateY (memento.xoz);
164+
transform->RotateZ (memento.xoy);
165+
transform->RotateX (memento.yoz);
166+
157167
if (false == memento.translationFirst)
158168
transform->Translate (memento.dx, memento.dy, memento.dz);
159-
transform->PostMultiply ( );
160169
} // else if (true == memento.isExtrinsic)
161170

162171
return transform;

versions.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 5.17.1 : 03/07/26
2+
================
3+
4+
Classe vtkTransformHelper : correctif Pre/PostMultiply dans le cas des transformations intrinsèques.
5+
6+
17
Version 5.17.0 : 24/03/26
28
================
39

0 commit comments

Comments
 (0)