Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
11-25-2005 22:46
I'm trying to make a targeting recticle, but I just can't seem to figure out what the viewing angle is in mouse look (IE, 180, 90, etc.) I think it's around 100, but even using that, things are off a little bit.
[edit] after some major trial and error I have it down to 90, but for some reason my "directed" scan is rotated 90 degrees to the right of my avatar. any ideas why this is?
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-26-2005 00:17
you should know that the x arc of the view is dependant on screen settings and camera configuration. Though clever manipulation you can see up to 180 degrees.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
11-26-2005 00:31
From: Strife Onizuka you should know that the x arc of the view is dependant on screen settings and camera configuration. Though clever manipulation you can see up to 180 degrees. just realized this, though the default for me seems to be close to 90 in mouse look. the orientation of the detection cone has thrown me for a loop however. Here's the code I'm using for the detection cone: key tarkey = NULL_KEY; vector tarpos = <0,0,0>; string tarname = "";
default { state_entry() { llSensorRepeat("",NULL_KEY,AGENT,40,(PI/40), 0.1); //should scan in a tiny cone pointed straight out from the avatar. it points 90 degrees to the right though :( llTargetOmega(<0,0,1>,PI/4,1); }
sensor(integer total_number) //since I just want the closest avatar under the reticle, I'm just using the avtars in the 0 position of the detection list { key tarkey = llDetectedKey(0); vector tarpos = llDetectedPos(0); string tarname = llDetectedName(0); llOwnerSay("found " + (string) total_number); //debugging check llSetText(tarname,<1,0,0>,.75); //label avatar under the reticle llSetColor(<1,0,0>,ALL_SIDES); //turn reticle red when an avatar is under it llTargetOmega(<0,0,0>,PI/4,1); //stop rotation when an avatar is under the reticle } no_sensor() { llSetText("",<0,0,0>,1); //clears text on the reticle llSetColor(<0,1,0>,ALL_SIDES); //sets reticle to green when there is no target under it llTargetOmega(<0,0,1>,PI/4,1); //sets reticle rotating again } }
and yes, I realize I have some variables that aren't used, but they will be later on once I get past this bug.
|
Stickman Ingmann
Regislered User
Join date: 15 Jul 2005
Posts: 12
|
11-26-2005 20:54
I don't know the answer or the facts that could lead to a solution I'm thinking of, but have you tried verifying the orientation of the object containing the script? Rotate it 90 degrees and see if it's pointing in the right direction. Let me try to explain better if that didn't get it. Situation: You have a single prim object with the detection script in it, oriented like this: X ^ | | _________ | | | | | | --> Z | | | | ````````` Your scan is coming out the Z axis, and you're getting it sideways. Rotate your object like so, and the problem should go away. This may require some redesign on your part. Z ^ | | ____________ | | X <-- | | | | ```````````` If for some reason the script is in a child prim then the same problem might apply. The root prim may be facing forward, but your prim with the scan is rotated. Check Edit Linked Parts and rotate it and it should be good. If all else fails and you can't edit the object easily, add another prim hidden within the other prims or llSetAlpha(1.0) so it's invisible, and align it as desired. Then again, the prim rotation may not be an issue at all. But that's the only thing I can think of that might be off here.
|