Multiple objs distorting (perspective?)

Hi I’m curious. I adapted the obj example to try and show 10 rockets in a row… The code works but the width of the rockets seem uneven… They are fatter towards the edges can anyone help?``

/**
 * Load and Display an OBJ Shape.
 *
 * The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
 * files and OBJ (Object) files into a Processing sketch. This example loads an
 * OBJ file of a rocket and displays it to the screen.
 */


PShape rocket;

float ry;

public void setup() {
  size(2000, 500, P3D);

  rocket = loadShape("rocket.obj");
}

public void draw() {
  background(0);
  lights();

  for (int i =1; i<11; i= i+1) {
    pushMatrix();
    translate(((width)/10)*i, height/2 + 100, -300);
    rotateZ(PI);
    rotateY(ry);
    shape(rocket);
    popMatrix();
  }



  ry += 0.02;
}

Hi @jimjimmer this is because the camera in P3D uses perspective as default, you need to change it to orthographic which is as simple as putting “ortho();” in setup or calling it before the shape is drawn then calling perspective(); after its drawn, problem is then you loose that 3d look, there are settings to ortho and perspective you may want to look at, dont really play around with 3d in processing

Thankyou, that’s perfect

1 Like

No worries then mate, can you mark it as solved please