We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › tint not working with P3D
Page Index Toggle Pages: 1
tint not working with P3D (Read 1517 times)
tint not working with P3D
Jul 25th, 2005, 8:20pm
 
Hi,

I've got a gif with a single colour + transparency that I've loaded into P5.  I'm trying to tint it and display it on screen in different colours.

My problem is that the tint() has no effect when in P3D mode. and when in OPENGL mode the tint works, but the transparent areas go to the colour of the background:

my code:

import processing.opengl.*;
PImage mb;
void setup(){

 size(600, 400, P3D);
//size(600,400,OPENGL);

 mb = loadImage("maze2.gif");
 background(0);
}

void draw(){
 background(0);
 translate(width/2, height/2, 50);
 rotateY(-float(300 - mouseX)/200);
 rotateX(float(200 - mouseY)/200);
 int i;
 tint(0);
 image(mb, -50, -50);
 
tint(0, 153, 204);
 for (i = 0; i < 20; i++){
   translate(0, 0, -20);
   image(mb, -50, -50);
 }
}
Re: tint not working with P3D
Reply #1 - Jul 25th, 2005, 8:21pm
 
and my question is:

How can I get it to work?

Smiley
Re: tint not working with P3D
Reply #2 - Jul 26th, 2005, 11:13am
 
I've realized my error with the OPENGL mode.. I was adding the images in the wrong order..

But I still don't understand why the tint function doesn't work with P3D...

Re: tint not working with P3D
Reply #3 - Jul 28th, 2005, 1:14am
 
tint() is broken in P3D in some cases. just a weird bug that showed up just before beta. hopefully will be able to fix it soon. see here for any follow-up:
http://dev.processing.org/bugs/show_bug.cgi?id=90
Page Index Toggle Pages: 1