Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Arc in UV texture detection?

Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
07-03-2009 15:15
Okay, I've been working on a project that requires me to split up a circle into twelve arcs (and by arc, I mean section of a circle stretching from the exact middle to the very edge). I need the script to understand/reply when someone has clicked inside of an arc. How could I go about doing this, without chopping off the edge of the circle? I want my detection to be fully on the circle, and not on an inscribed dodecagon.

To sum it all up, I'm basically asking how to "bend a line".

Any help would be VERY much appreciated.
Carbon Philter
Registered User
Join date: 4 Apr 2008
Posts: 165
07-03-2009 15:40
Maybe use llDetectedTouchUV with lots of conditional if statements to define the limits of the wedge?
Getting a bit too mathematical/geometric for me to think about in detail.

:D
Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
07-03-2009 15:41
I was thinking about that, but if that's what I *have* to do.. I'll just slice it off, and warn people. =P
Carbon Philter
Registered User
Join date: 4 Apr 2008
Posts: 165
07-03-2009 15:56
Rectangular is the new wedge...... go radical! lol
Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
07-03-2009 16:04
I'd still *really* like to know any specific way to do this.. if anyone is out there who can help..
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-03-2009 16:17
use a cylinder(top/bottom)? that'll only return results inside the circle, then you can use llAtan2 to figure out the angle of the touch from center which will tell you what slice it's in. the logic depends on how many slices you have and where they're centered.

suggested requirements
cylinder sliced to .49/.51 with a minimal z size, llDetectedTouchST (offset by -.5,-.5), and llAtan2 to get your circular angle. probably a texture that makes it easy too.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
07-03-2009 16:35
Angles! Thank you; I kinda feel like an idiot. I shoulda' thought of that. =P
Thanks a million!
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-03-2009 17:01
nah it's easy to get too close to a problem.... I've seen some scary solutions that would have worked for some some things when a simple solution was available... finesse is sometimes a lit harder than it looks ;)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -