Processing.js texture() Error

edited June 2014 in JavaScript Mode

Hi all, I have the following piece of code:

beginShape();
  texture(lig);
  for (Inters inte: intersects) {

   vertex((float)inte.x1, (float)inte.y1, (float)inte.x1+(radius/2)-posX, (float)inte.y1+(radius/2)-posY);
  }

  endShape();

This works perfectly fine in Processing, but not in Processing.js. And yes, I have preloaded the texture image.

Error:

Uncaught TypeError: Cannot read property '__texture' of null processing.js:6097
p.texture processing.js:6097
cast$0 VM54:220
castLight$0 VM54:56
draw VM54:454
Drawing3D.redraw processing.js:4053
(anonymous function)

Thanks in advance.

Answers

  • edited June 2014

    Never used texture() before. But I do know that we can't use remotely loaded images! Check whether it's your case there! 8-X

  • GoToLoop, I am not remotely loading images. I can confirm that the image loads since it draws fine.

  • Does anyone have any suggestions?

  • edited June 2014

    I can confirm that the image loads since it draws fine.

    It's irrelevant whether the images have loaded fine. Just make sure they're loaded from the same host Processing app runs! :-@

  • They are loaded from the same host.

Sign In or Register to comment.