PDA

View Full Version : getting a point's colour



Karmacop
10-27-2003, 08:28 AM
Just getting back into making some scripts. I've always been a bit confused with this vmap stuff so I was wondering if I could get some help.

I want to get the vmap colour as 3 vectors from a point. Would I do it using something like this

for(pnt = 1; pnt <= pntCnt; pnt++)
{

if(vmapObj.isMapped(points[pnt]))
oldClr = vmapObj.getValue(points[pnt]);

then oldClr[1] is red, oldClr[2] is green, and oldClr[3] is blue? ... I have of course chosen VMRGB as my map type :)

Ofcourse this doesn't work .. I'm not sure how to do it :(

Thanks for your help!

Dodgy
10-27-2003, 10:12 AM
Have you chosen your assigned your vmapObj to a vmap first?

myvmap= VMap(VMTEXTURE,0) || error("No UV maps defined");


Will get the currently selected UV vmap...

Karmacop
10-27-2003, 10:27 AM
Hmm .. ok, I'm not sure what I changed btu it's working now. I was getting oldClr as an undefined array before :\

Ok, my new trouble, when using ctlcolor and then clr = getvalue(c1); , clr isn't defined as an array, it's just seen as <255,255,255> for example. How do I change this to an array? :\

Thanks for your help Dodgy :)

Dodgy
10-27-2003, 11:28 AM
It's coming through as a vector.

Use
myarray[1]=mycolour.x;
myarray[2]=mycolour.y;
myarray[3]=mycolour.z;

to convert it into an array.

Karmacop
10-28-2003, 08:29 PM
Thanks for your help! My script is now up and running fine. It's a bit weird defining rgb as xyz though :\