# Problem with .obj file (scale shape)

**URL:** <https://discourse.processing.org/t/problem-with-obj-file-scale-shape/43390>\
**Category:** Coding Questions\
**Created:** [December 4, 2023, 4:36pm UTC](https://discourse.processing.org/t/problem-with-obj-file-scale-shape/43390 "2023-12-04T16:36:57Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [December 5, 2023, 6:10am UTC](https://discourse.processing.org/t/problem-with-obj-file-scale-shape/43390/5 "2023-12-05T06:10:10Z")

</div>

Hello @Philippe1 ,

> [@Philippe1](#):
>
> shape(ball, 200, 200, 300,300);

This will only resize the width (x) and height (y).

You need to scale the x, y and z:

`ball.scale(100, 100, 100); //scale the x, y and z`

Example using the default cube in Blender:

```auto
void setup() 
  {
  size (500, 500, P3D);
  ball = loadShape("untitled.obj");
  ball.scale(100, 100, 100); //scale the x, y and z of the shape
  }

void draw() 
  {
  background(20);
  lights();
  translate(width/2, height/2);
  rotateY(frameCount*(TAU/360));
  shape(ball, 0, 0);
  }

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/8/082b397e499ae2e9bc96f1890d6a2047f561666b.png)

Reference:

> **[shape() / Reference](https://processing.org/reference/shape_.html)**
>
> Draws shapes to the display window. Shapes must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the shape. Processing currently works with SVG…

Another example:

> [@Rotate a PShape](https://discourse.processing.org/t/rotate-a-pshape/32859/3):
>
> Hello, Example: 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(); } You can find the rocket here: [image] And here: [https://github.com/proc…](https://github.com/processing/processing-docs/tree/master/content/examples/Basics/Shape/LoadDisplayOBJ/data)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/problem-with-obj-file-scale-shape/43390)._
