# transform\_rotation problem (with code and pic)

**URL:** https://discourse.paraview.org/t/transform-rotation-problem-with-code-and-pic/14739
**Category:** ParaView Support
**Created:** [May 30, 2024, 3:00am UTC](https://discourse.paraview.org/t/transform-rotation-problem-with-code-and-pic/14739 "2024-05-30T03:00:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tigerhu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d2c977/32.png) [@tigerhu](https://discourse.paraview.org/u/tigerhu)
#### Post date: [May 30, 2024, 3:00am UTC](https://discourse.paraview.org/t/transform-rotation-problem-with-code-and-pic/14739/1 "2024-05-30T03:00:01Z")

</div>

Hi,  
I conducted object rotation using **paraview.simple.Transform.rotate** function, tested on a cylinder with different angles, and found a possible wrong answer.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/b45c27890e662c49e14902282d477785c5ade29c.png)

In the image above, black is the initial cylinder,  
red is rotated by [45, 0,0] , which is correct  
green is rotated by [45, 0, 90], which is also correct  
blue is rotated by [45, 90, 0], which coincides with red, and I don’t think it is correct.  
Does anyone have idea if it is a bug or I was wrong? Any advice or suggestion is appreciated!

Here is a link to refer, and below is part of code that I have used to generate the image above  
[rotate object given center and degrees](https://discourse.paraview.org/t/rotate-object-given-center-and-degrees/1638)

> Blockquote  
> from paraview.simple import \*  
> radius = 2  
> length = 50  
> // INITIAL CYLINDER  
> cylinder = Cylinder(registrationName=‘CylinderInitial’)  
> cylinder.Resolution = 389  
> cylinder.Height = length  
> cylinder.Radius = radius  
> Show(cylinder)  
> // INITIAL SPHERE  
> sphere = Sphere(registrationName=‘SphereInitial’)  
> sphere.Center = [0,0,0]  
> sphere.Radius = 4.0  
> Show(sphere)  
> // BLACK  
> transform\_0 = Transform(Input=cylinder, registrationName= ‘rotate [0, 0, 0]’)  
> transform\_0.Transform.Rotate = [0, 0, 0]  
> transform\_0.UpdatePipeline()  
> Show(transform\_0)  
> // **RED rotation 1**  
> transform\_1 = Transform(Input=cylinder, registrationName= ‘rotate [45, 0, 0]’)  
> transform\_1.Transform.Rotate = [45, 0, 0]  
> transform\_1.UpdatePipeline()  
> Show(transform\_1)  
> // **GREEN rotation 2**  
> transform\_2 = Transform(Input=cylinder, registrationName= ‘rotate [45, 0, 90]’)  
> transform\_2.Transform.Rotate = [45, 0, 90]  
> transform\_2.UpdatePipeline()  
> Show(transform\_2)  
> // **BLUE rotation 3**  
> transform\_3 = Transform(Input=cylinder, registrationName= ‘rotate [45, 90, 0]’)  
> transform\_3.Transform.Rotate = [45, 90, 0]  
> transform\_3.UpdatePipeline()  
> Show(transform\_3)
