# how to rotate a .obj object

**URL:** https://discourse.vtk.org/t/how-to-rotate-a-obj-object/8117
**Category:** Development
**Created:** [March 23, 2022, 9:23am UTC](https://discourse.vtk.org/t/how-to-rotate-a-obj-object/8117 "2022-03-23T09:23:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![george66s](https://discourse.vtk.org/user_avatar/discourse.vtk.org/george66s/32/4786_2.png) [@george66s](https://discourse.vtk.org/u/george66s)
#### Post date: [March 23, 2022, 9:23am UTC](https://discourse.vtk.org/t/how-to-rotate-a-obj-object/8117/1 "2022-03-23T09:23:23Z")

</div>

Hi, I am trying to rotate an object with .obj format. Is there any example that I can learn from?

I checked out the example RotationAroundLine.cxx. It is about rotating an Arrow. It has the following code:

```
// Create arrow
vtkNew<vtkArrowSource> source;

// Create a transform that rotates the arrow 45° around the z-axis
vtkNew<vtkTransform> transform;
transform->RotateWXYZ(45, 0, 0, -1);
vtkNew<vtkTransformPolyDataFilter> transformFilter;
transformFilter->SetTransform(transform);
transformFilter->SetInputConnection(source->GetOutputPort());
transformFilter->Update();

```

My issue is when I use vtkSmartPointer polyData to read a .obj file, I can not find equivalent method to perform transformFilter-\>SetInputConnection(source-\>GetOutputPort()) for polyData. Can anyone help?

Thanks!

---

<div class="post-metadata">

### Author: ![george66s](https://discourse.vtk.org/user_avatar/discourse.vtk.org/george66s/32/4786_2.png) [@george66s](https://discourse.vtk.org/u/george66s)
#### Post date: [March 29, 2022, 2:26am UTC](https://discourse.vtk.org/t/how-to-rotate-a-obj-object/8117/2 "2022-03-29T02:26:19Z")

</div>

Found related examples, check out following link:

[https://kitware.github.io/vtk-examples/site/Cxx/Rendering/Rotations/](https://kitware.github.io/vtk-examples/site/Cxx/Rendering/Rotations/)
