Rotation movement during noLoop

Hi,
I’m new to coding for my student work.
I’m making combining random objects + random words.
I’m trying to put related code and some point it’s working.
But when I put noLoop, the rotation movement is not working…
Can I show the movements of objects during noLoop. and if it refresh the window, it will show different objects.

let sculptures;
let numSculptures = 3;
let sculptures1;
let numSculptures1 = 3;

function preload() {
  let sculpture1 = loadModel('obj/furniture1.obj' ,true);
  let sculpture2 = loadModel('obj/furniture2.obj',true);
  let sculpture3 = loadModel('obj/furniture3.obj',true);
  sculptures = [sculpture1,sculpture2, sculpture3];
  sculptures1 = [sculpture1,sculpture2, sculpture3];
}

function setup(){
  createCanvas(windowWidth,600,WEBGL);

}

function draw() {
  background('gray');
  noLoop();

  let locX = height / -2;
  let locY = width / -2;

  ambientLight(200, 200, 200);
  pointLight(200, 200, 200, locX, locY, 100);
  fill('white')
  noStroke();
  ambientMaterial(250);
  scale(2);
  translate(0,-40,0);
  
  rotateY(millis()/1000);
  rotateX(millis()/1000);
  let randoObj = random(sculptures)
  model(randoObj);
  translate(0,0,0);
  

  let randoObj1 =random(sculptures)
  rotateY(millis()/1000);
  rotateX(millis()/1000);
  model(randoObj1);
  translate(0,-40,0);
  
}

I’ll share my code.
Many thanks in advance!

1 Like

This is consistent with the function of noLoop():

:)

just don’t use noLoop

ever

I am not sure I understand what you want to achieve

draw() loops 60 times per second (when not using noLoop()) which is good for animation and so on

So, draw() will automatically show different objects every frame when you tell it to. OR do you want to have an automatically change after 5 seconds for example? Then you need a timer. Lots of examples in the forum or ask again here.

I personally don’t believe in noLoop() or loop() which lets draw run again.

Hey, and welcome to the processing forum, great to have you here!

Warm regards,

Chrisir