# Rotation movement during noLoop

**URL:** https://discourse.processing.org/t/rotation-movement-during-noloop/25629
**Category:** Coding Questions
**Tags:** homework
**Created:** [November 23, 2020, 10:04am UTC](https://discourse.processing.org/t/rotation-movement-during-noloop/25629 "2020-11-23T10:04:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sally](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@sally](https://discourse.processing.org/u/sally)
#### Post date: [November 23, 2020, 10:04am UTC](https://discourse.processing.org/t/rotation-movement-during-noloop/25629/1 "2020-11-23T10:04:54Z")

</div>

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.

```auto
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!

---

<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: [November 23, 2020, 12:01pm UTC](https://discourse.processing.org/t/rotation-movement-during-noloop/25629/2 "2020-11-23T12:01:57Z")

</div>

> [@sally](#):
>
> But when I put noLoop, the rotation movement is not working…

This is consistent with the function of noLoop():

> **[reference | p5.js](https://p5js.org/reference/#/p5/noLoop)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

`:)`

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 23, 2020, 5:16pm UTC](https://discourse.processing.org/t/rotation-movement-during-noloop/25629/3 "2020-11-23T17:16:53Z")

</div>

just don’t use noLoop

ever

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 23, 2020, 7:47pm UTC](https://discourse.processing.org/t/rotation-movement-during-noloop/25629/4 "2020-11-23T19:47:17Z")

</div>

> [@sally](#):
>
> Can I show the movements of objects during noLoop. and if it refresh the window, it will show different objects.

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
