Smooth color changing texture
|
Mokomoko Bayn
Registered User
Join date: 28 Nov 2009
Posts: 2
|
12-14-2009 11:38
Hey guys, I want to have a texture which i can put on my Objekt, insert a Textur_Anim Script and than, it should looks like it's changing its color from Red to pink to blue to green and so one. All colors should be seen. (expect black and white) I know its not easy to understand, but that's because my english is worse xD
Can you help me?
Greetz, Mokomoko
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
12-14-2009 11:54
So make yourself a grid in Photoshop (or whatever) and fill each of the squares in the grid with a different color, following the spectrum from red in the first box to deep violet in the last one. Use as many boxes as you like, or as many as you think you'll need for making the color transitions smooth. Then, upload your grid, apply it to a prim, and add a simple script that says default { state_entry() { llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, Row, Column, 1, 1, 1); } }
in which you substitute the number of squares per row and the number per column for the words "Row" and "Column." Ignore the tags, BTW. They are formatting codes for these forums.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Mokomoko Bayn
Registered User
Join date: 28 Nov 2009
Posts: 2
|
12-14-2009 12:17
From: Rolig Loon So make yourself a grid in Photoshop[...] Isn't there any created grid yet? That would be many work for me. And I dont know how to do it perfectly 
|
Laurie Stilman
Registered User
Join date: 11 Apr 2006
Posts: 45
|
12-14-2009 13:39
From: Mokomoko Bayn Hey guys, I want to have a texture which i can put on my Objekt, insert a Textur_Anim Script and than, it should looks like it's changing its color from Red to pink to blue to green and so one. All colors should be seen. (expect black and white) I know its not easy to understand, but that's because my english is worse xD Let's try to clarify what you want to do... Do you want the entire object to be all the same colour, but have that colour constantly changing? Or do you want a moving gradient of two or more colours at once? The first you can do by animating the prim's colour, without any textures. To accomplish the latter, you'll need to make (or obtain) a texture that has the right kind of gradients in it for the effect you want. Since the range of possible effects is pretty large, it's difficult to offer more specific advice. In this case, start by looking at the documentation for the llSetTextureAnim() function that Rolig mentioned to get an idea of the kinds of animation that are possible, then think about how to combine that with an image to get the effect you want. Unfortunately, you probably will need to figure out how to create the image if you want a specific effect, though depending on what exactly you want to achieve you might be able to find a pre-existing image that would work. L.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
12-14-2009 14:15
From: Mokomoko Bayn Isn't there any created grid yet? That would be many work for me. And I dont know how to do it perfectly  A grid like that isn't the sort of thing that you'll find just lying around in SL; it's a custom texture that most people would make for themselves as they need it. It's a nice easy lesson for you to start with, too. Making a couple of rows of colored boxes shouldn't take very long at all. As Laurie says, you can get the same effect by using a script, too, without creating a texture at all. There again, you'll have to either write the script yourself or find a scripter willing to write it for you.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
|
12-14-2009 17:10
You can get a passable color cycling effect by using a gradient image and animating it. I knocked up a quick example using the PhotoShop gradient fill tool. Saved image as a 256 x 128 PNG and then used a texture animation script with parameters that effectively stretch the gradient. Though at any given time the face is still a gradient with the right initial image and stretching the result is a passable color cycling effect. Well, at least I think so  Can see it here: http://www.youtube.com/watch?v=M2WwJQry73Ahttp://www.youtube.com/watch?v=M2WwJQry73ARime
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
12-14-2009 17:32
OK.... And here's a scripted solution that works too. It is fairly laggy, so I recommend turning it off when you really don't need it. (It's also fairly clunky, but I can't quickly think of a cleaner way to run around the spectrum.) // Rainbow -- Rolig Loon -- December 2009 // Place in contents of a prim. Touch to start or stop
integer ON = FALSE; integer loop; float x; default { touch_start(integer total_number) { llSetTimerEvent(0.5*(ON = !ON)); loop = 1; x = 0; }
timer() { if(loop == 1) { llSetColor(<1,0.2*x,0>,ALL_SIDES); x = x+0.25; if (x > 5) { loop = 2; x = 5; } } else if (loop ==2) { llSetColor(<0.2*x,1,0>,ALL_SIDES); x = x-0.25; if(x < 0) { loop = 3; x = 1; } } else if (loop == 3) { llSetColor(<0,1.0-(0.2*x),0.2*x>,ALL_SIDES); x = x+0.25; if(x > 5) { loop = 4; x = 5; } } else if (loop == 4) { llSetColor(<1.0-(0.2*x),0,1>,ALL_SIDES); x = x-0.25; if(x < 0) { loop = 5; x = 1; } } else if (loop == 5) { llSetColor(<1,0,1.0-(0.2*x)>,ALL_SIDES); x = x+0.25; if (x > 5) { loop = 1; x = 0; } } } }
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
12-14-2009 17:37
1e7eb901-0fe6-62e5-6f46-db79436079d9
|
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
|
12-14-2009 18:02
...and texture animation using a full spectrum gradient (with a little too much white, darn it!) http://www.youtube.com/watch?v=XyVeJzguvQMhttp://www.youtube.com/watch?v=XyVeJzguvQMThe nice thing about texture animations is (correct me if I am wrong) that once they are started they use no script time and are a viewer driven effect. Rime
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
12-14-2009 18:06
You're right, Rime. Your solution is far superior to my scripted on for that reason. I only posted mine to show that it could be done, not because it's the best way.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Rime Wirsing
Color me gone
Join date: 31 Dec 2008
Posts: 345
|
12-14-2009 18:12
Not superior, Rolig, just another way to skin the proverbial cat  I sent Mokomoko a full perm example prim in world with the texture and script to have a play with. I do enjoy these little puzzles even if they have been asked and answered a zillion times before. Helps me learn a few things each time, and I still have a long way to go.
|