# Rotate a PShape

**URL:** <https://discourse.processing.org/t/rotate-a-pshape/32859>\
**Category:** Libraries\
**Created:** [October 16, 2021, 12:02am UTC](https://discourse.processing.org/t/rotate-a-pshape/32859 "2021-10-16T00:02:36Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 16, 2021, 10:15am UTC](https://discourse.processing.org/t/rotate-a-pshape/32859/3 "2021-10-16T10:15:07Z")

</div>

Hello,

Example:

```auto
PShape obj;

void setup()
{
  size(500, 500, P3D);
  smooth();
  background(0);
  obj = loadShape("rocket.obj");
  obj.rotateZ(TAU/2);
  obj.translate(0, 100, 0);
  obj.scale(.8, .8, .8);
}
void draw()
  {
  background(0);
  translate(width/2, height/2);
  //pushMatrix();
  
  // This: 
  //rotateY(frameCount*TAU/360);
  // Or this:
  obj.rotateY(TAU/360);
  
  shape(obj);
  //popMatrix();
  }

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/aaadbd2225e854b0a3a03a285aad3ff2f3fed0fc.png)

You can find the rocket here:

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/50a0d3d7357df28e67153b23ac2051833c19daf2.png)

And here:  
[https://github.com/processing/processing-docs/tree/master/content/examples/Basics/Shape/LoadDisplayOBJ/data](https://github.com/processing/processing-docs/tree/master/content/examples/Basics/Shape/LoadDisplayOBJ/data)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/rotate-a-pshape/32859)._
