# Image Array as texture WebGL

**URL:** https://discourse.processing.org/t/image-array-as-texture-webgl/40405
**Category:** p5.js
**Created:** [January 2, 2023, 5:04pm UTC](https://discourse.processing.org/t/image-array-as-texture-webgl/40405 "2023-01-02T17:04:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mfcgrp](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mfcgrp](https://discourse.processing.org/u/mfcgrp)
#### Post date: [January 2, 2023, 5:04pm UTC](https://discourse.processing.org/t/image-array-as-texture-webgl/40405/1 "2023-01-02T17:04:08Z")

</div>

Hello,  
I am attempting to texture an obj file with an image array.  
It will load an image but not loop through the array. Outside of WebGL loading and displaying an image array is fairly simple, but it seems there may be additional steps here that I can’t find documentation on. Thank you in advance for help!

Here is the relevant code:

//object  
let berg;  
//texture for berg  
var texturesArray = ;

function preload() {  
//preload for array to texture obj  
for (var i=0; i\<74; i++) {  
texturesArray[i] = loadImage(“DataImg/Data”+i+“.png”);  
}  
}  
function setup() {  
createCanvas(770, 700, WEBGL)

}  
function draw() {  
background(0);

//for loop to texture obj from array  
for(var i=0; i\<74; i++) {  
texture(texturesArray[i]);  
}

model(berg);  
}
