Jump to content

kayra Rae

Resident
  • Posts

    2
  • Joined

  • Last visited

Everything posted by kayra Rae

  1. Thank you SO MUCH, Dora!!! This is exactly what I was looking for! )) I'm curious about the local orientation, however. This is for a tail, which is attached to me, and i can be facing any direction, and the prim of course has it's own positioning while attached. So my guess is i'll have to take that into consideration. I've seen a method that derives a global orientation from a local one. Would I need to convert first the orientation of the prim before I apply the x and y vector components to the prim? Or would I calculate this delta and apply it to the values I pass to llSetPrimitiveParams?
  2. Hi all! :) I'm trying to create a flexi prim that will "point" at the closest avatar to it. I've seen this before and have decided to try it for mysely. At first I tried llLookAt. This works well for pointing, but ends up "uprooting" the flexi prim and rotating it like a weather vane. I need the flexi prim to stay "grounded" to what it's attached to, and simply "lean" towards the avatar. So, llSetPrimitiveParams seems like the only route, using the 'force' vector to "push" the top of the flexi prim towards the target. I did some experiments using the "force" vector and found that I can point the flexi by varying the x and y components of the "force" parameter to llSetPrimitiveParams. Here's a simple example for cardinal directions: PointFlexi( string dir ) { // point the tail at p, which is either a person or cardinal direction. vector pointdir; if( dir == "west" ) { llOwnerSay( "Pointing west" ); pointdir = <10, 0, 0>; } else if( dir == "north" ) { llOwnerSay( "Pointing north" ); pointdir = <0, 10, 0>; } else if( dir == "east" ) { llOwnerSay( "Pointing east" ); pointdir = <-10, 0, 0>; } else if( dir = "south" ) { llOwnerSay( "Pointing south" ); pointdir = <0, -10, 0>; } llSetPrimitiveParams( [ PRIM_FLEXIBLE, 1, 3, 0.3, 0.6, 0.0, 1.0, pointdir] ); } The problem I can't wrap my head around is how best to translate an object or avatar's location into a "force" value I can apply to my flexi prim in order to point it. So far what I've come up with is that I can run llSensorRepeat() and get an llDetectedPos() and my llGetPos(), then I'd need to conjure some math to get a directional vector between the two objects, then somehow translate that angle to the force value I need for llSetPrimitiveParams(). Gah!! :P Can anyone shed some light on this for me? I'd be soooo grateful! Thanks!
×
×
  • Create New...