crazydudemartijn Posted June 13, 2018 Share Posted June 13, 2018 im searching for a script that colors a object by usings the nearest persons uuid within 10 meters if it cant find any it uses owners uuid for all faces and linked parts Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 13, 2018 Share Posted June 13, 2018 I don't understand what you mean. How are you turning a UUID into a color? Link to comment Share on other sites More sharing options...
crazydudemartijn Posted June 13, 2018 Author Share Posted June 13, 2018 idk ether but i saw some do it Link to comment Share on other sites More sharing options...
Fionalein Posted June 13, 2018 Share Posted June 13, 2018 cheapo idea: modulo UUID by 256 -> treat result as 8bit colour -> run algorithm to convert result into the 3 8bit RGB modern computers use Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted June 13, 2018 Share Posted June 13, 2018 39 minutes ago, Fionalein said: cheapo idea: modulo UUID by 256 -> treat result as 8bit colour -> run algorithm to convert result into the 3 8bit RGB modern computers use Good ol' binary. Might as well. vector Key2Color(key id) { integer value = (integer)("0x" + llGetSubString(id, 0, 5)); return <(value&255)/255.0, ((value>>8)&255)/255.0, ((value>>16)&255)/255.0>; } default { state_entry() { llSetColor(Key2Color(llGetOwner()), ALL_SIDES); } } In short, the function I wrote above takes the first 6 characters of any given UUID (RGB is 6 hexadecimal symbols long), converts them into an integer (so we can use bitwise operators), and checks the first 8 bits (2 hexadecimal symbols) which will give you a value between 0 and 255, then divides that value by 255 to get down to the proper [0.0 - 1.0] range used for color vectors in LSL. The rest is up to you. 2 Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 13, 2018 Share Posted June 13, 2018 hmm, could combine this with someone's height maybe to be a more unique aura assuming some uuids might result in the same color alone Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted June 13, 2018 Share Posted June 13, 2018 1 minute ago, Ruthven Willenov said: hmm, could combine this with someone's height maybe to be a more unique aura assuming some uuids might result in the same color alone You are correct with your concern. Even if you took a larger set of characters to turn into an integer, there could still be two people with the same integer, or "close enough." No matter how much randomization you add into the mix, there will be "collisions." The human eye can't detect enough colors to guarantee every person to have a unique color from each other. Link to comment Share on other sites More sharing options...
Qie Niangao Posted June 14, 2018 Share Posted June 14, 2018 I'm not sure if the objective is for these to be visually distinctive to the human eye, or if the goal is to encode a UUID in the surface tint of enough faces and links to be a persistent record perhaps for use by a script that might need to recover the information after being reset. If the latter, the alpha channel could add another eight bits to each face, and of course there are lots of other properties that might be set -- especially if the object is made of prims rather than mesh. Finding places to squirrel-away such data used to be a thing. Historically, some of these have gotten in trouble by relying on fields that later were truncated or subject to different validation. Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted June 14, 2018 Share Posted June 14, 2018 (edited) 5 hours ago, Qie Niangao said: I'm not sure if the objective is for these to be visually distinctive to the human eye, or if the goal is to encode a UUID in the surface tint of enough faces and links to be a persistent record perhaps for use by a script that might need to recover the information after being reset. If the latter, the alpha channel could add another eight bits to each face, and of course there are lots of other properties that might be set -- especially if the object is made of prims rather than mesh. Finding places to squirrel-away such data used to be a thing. Historically, some of these have gotten in trouble by relying on fields that later were truncated or subject to different validation. My understanding was that OP wants the whole object be one color based on the key of the closest avatar. It doesn't sound like they want to store any real info. Edited June 14, 2018 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now