Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

TouchUV problem

Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
01-18-2010 13:44
I am using the llDetectTouchUV(0) on a simple object and am puzzled by the results.
If I create a simple square box 4m x 4m x 0.2m and embed the script:

default
{
touch_start(integer total_number)
{
vector UV = llDetectedTouchUV(0);
float U = UV.x;
float V = UV.y;
llOwnerSay("U: " + (string)U + " V: " + (string)V);
}
}

then touch the box in the SW corner of the top face I get values close to 0.0 for U and V, and appropriately if I touch the NE corner values close to 1.0.
If I then apply a texture to the top face I get similar results but if I change the repeats per face in the horizontal direction U to say 0.5 the SW corner gives me a U value of about 0.25.
Is the texture what is being tested or the face?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-18-2010 13:54
If you use llDetectedTouchUV, you are detecting position on the texture. If you use llDetectedTouchST, you are detecting position on the face.
_____________________
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
Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
01-19-2010 01:12
OK Thanks. I promise to read more fully the text describing the different commands.