Jump to content

sensor arc


Tabris Daxter
 Share

You are about to reply to a thread that has been inactive for 4040 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

hi all,

is there any way to visually represent a sensor arc by using particles.

i want to be able to "tune" the sensor arc to a very narrow area (2 x 2 m @ ~96m) and if i have a visual representation it will be easier to do.

 

all i'm really asking for is the section in the particle script so i can change 1 variable and either grow or shring the sensor arc and the particles at the same time.

Link to comment
Share on other sites

The smug answer would be "Experiment", the truthful one "You've got me there, I'm hoping someone will come along with a better brain and, preferably, some numbers".

Failing that I'd suggest starting with just making a tight cone of particles.  Sensor's arc should (if I'm picturing it properly) translate to PSYS_SRC_ANGLE_END so it shouldn't (complete cop-out again) be too hard to control the spread.  The next trick is that sensor is oriented to the object's positive-x, while particles are positive-y.  That means you'll need to shift the direction the whole cone points, or give up and cheat by using a rotated particle prim 'inside' the sensor prim so the particles and sensor point the same way in the first place.

[i love the versatility of particles.  Looks like I should practice some more ^^]

ETA: A voice from the other side tells me to use a second prim, as mentioned, with ...ANGLE_BEGIN as 0.0 and ...ANGLE_END as your sensor arc.

Link to comment
Share on other sites

Despite the name "sensor arc", it is better to think of the sensor area as a sphere which can turn into a cone if dimpled enough.

Rez a sphere. Set the rotation to 0, 0, 0. Look at Dimple End: 1.0. Multiply by PI and that gives you the sensor arc value for your sensor to scan a full sphere. 0.5 makes a half sphere. 0.25, for example, and it really looks like a cone.

Now, working with a sphere of 96m is impractical, so work with a sphere of 9.6m and set a cube of 0.01x0.2x0.2 at the position of the sphere plus <9.6, 0, 0>. Lower the Dimple End until the edge of the wide end of the cone surrounds the cube. (You can enter more decimals than you can see in the floater.) Use this value multiplied by PI as sensor arc.

As you will see, the cube must be just a little closer than 9.6m for everything to work.

Hope it helps...

Link to comment
Share on other sites

Hmmm... It seems I forgot that dimple is quite limited and may not work for the dimensions you need. (I did not test in-world.) Let's do some mathematics instead, assuming a distance of 95m.

Pythagore, right rectangle, hypothenuse, Pythagore again, hypothenuse, adjacent side, cosinus, acute angle...

sensor arc = acos( distance / sqrt(sqrt( (square_size/2)² + (square_size/2)² )² + distance²) )sensor arc = acos( 95 / sqrt(sqrt(2)² + 95²) )sensor arc = approx. 0.01488535

 (This is not LSL code.)

In theory, it works. Test it and keep us informed.

There is no lower limit to the sensor arc, but like for everything in SL, I would not go below 0.01.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4040 days.

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
 Share

×
×
  • Create New...