Jump to content

Prims 'watch' and move/rotate too a moving prim. Please help.


MrBobbins
 Share

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

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

Recommended Posts

Hi guys, I've mustered up the energy to move my ass onto here to ask for help on awee build I'm doing. I'm not very well and I'm struggling using my brain, which is a challenge when I operate normally XD.

 

Basically I have a series of spotlights, pointing up. These are arranged in a circular formation. What I envisage, is all these spotlights, facing up to start will be following/looking at an invisible prim. This invisible prim will move up, and down, a wide clockwise circle, complete, then anticlockwise, stop, then repeat. This movement, I am fine with, and the prim (not currently invisible) is doing what I want it to do \o/.

But I just do not know where to start with these spotlights, so as the invisibale prims moves down, the spotlights move as if watching/pointing their beams to this prim, and basically every movement it makes. Making a nice little moving display of lighting. 

I hope someone can point me in the right direction to a script or something that I can achieve this with.

 

Many thanks for reading, and I hope someone can help soon.

Link to comment
Share on other sites

Hi Mr. Bobbins,

I think you'll want to fiddle with llLookAt()...

http://wiki.secondlife.com/wiki/LlLookAt

There's an avatar following example script on that page that you can modify to track a prim. As a proof of concept, you could drop that script into your lights and then walk/fly to see if the effect is suitable.

If so, then you make your invisible prim a child in the lighting array linkset and move it via script (as you're already doing). Then you send the prims coordinates to all the light prims using llMessageLinked(). That shouldn't be too difficult, as you are generating the coordinates for the prim's motion already, you simply send those same coordinates to all of the lights.

You'll want to use PRIM_POS_LOCAL in llSetLinkPrimitiveParamsFast() to move the invisible prim, and will have to do a local to global coordinate conversion before passing the position to the lights.

And there's really no reason to have the invisible prim if the only purpose it serves is to guide the lights. The script code that moves the prim can inform the lights without need for the prim.

Have fun!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3280 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...