Tabris Daxter Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
PeterCanessa Oh Posted January 11, 2012 Share Posted January 11, 2012 http://wiki.secondlife.com/wiki/LlParticleSystem - you'd want to use: PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE, PSYS_SRC_ANGLE_BEGIN, n.nnn, SYS_SRC_ANGLE_END, n.nnn Link to comment Share on other sites More sharing options...
Tabris Daxter Posted January 11, 2012 Author Share Posted January 11, 2012 i was looking at that but how do i tie that into http://wiki.secondlife.com/wiki/LlSensor llSensor( string name, key id, integer type, float range, float arc ); Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
Kaluura Boa Posted January 11, 2012 Share Posted January 11, 2012 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 More sharing options...
Tabris Daxter Posted January 11, 2012 Author Share Posted January 11, 2012 What is the smallest value I can enter in the sensor arc as @ 32m radius the smallest "cone" is ~3.85m wide (0.0B , 0.02E) *EDIT: measured it and forgot is was 64m DIAMETER Link to comment Share on other sites More sharing options...
Kaluura Boa Posted January 13, 2012 Share Posted January 13, 2012 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 More sharing options...
Tabris Daxter Posted January 13, 2012 Author Share Posted January 13, 2012 Works in limited testing. I.e. rezzing a cube dumping a sensor script (merged with particles) in and repeatedly tweaking until it gave me results. ~0.00135 @ 96m is about right. there were 2 avis standing about 3m apart and i only got 1 & rotating a deg +-0.5 got the other. Link to comment Share on other sites More sharing options...
Recommended Posts
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