Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llRotLookAt headaches

Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
12-17-2005 17:13
Hi all,

Just to pass time I made a bird, got it to move randomly inside a bounding area, etc. It's all nifty.

Ok but the bird flies butt first sometimes, side first other times, it's very annoying. I cant seem to get a consistent side of the prim with the script in it to face the destination when using llRotLookAt().

Any suggestions? :confused:
_____________________
----------------------------------------------------------
--The mind's eye is limited only by its focus--
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
12-17-2005 18:05
From: Synergy Belvedere
Hi all,

Just to pass time I made a bird, got it to move randomly inside a bounding area, etc. It's all nifty.

Ok but the bird flies butt first sometimes, side first other times, it's very annoying. I cant seem to get a consistent side of the prim with the script in it to face the destination when using llRotLookAt().

Any suggestions? :confused:

I am not in world atm, but maybe something along these lines?

CODE
vector origin = llGetPos();
origin.x = destination.x + randomx;
origin.y = destination.y + randomy;
origin.z = destination.z + randomz;
vector destination = ZERO_VECTOR - origin;
llRotLookAt(llRotBetween(<-1, 0, 0>,(destination - origin)) , 0.5, 0.5);



randomx, randomy and randomz would be your randomly generated values for movement. Like I said, not in world, so I can't confidently stand behind this. I'll try and get in world in a bit and check it out for ya though.
~Cid
_____________________
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
12-17-2005 20:10
:(

Didnt work
_____________________
----------------------------------------------------------
--The mind's eye is limited only by its focus--
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-17-2005 23:43
I use a short timer that uses llLookAt to have my A-life fish look where they're going. I don't have acess to the script ATM, but it uses llGetVel (vector along which the prim is traveling) with llGetPos() to get the point that the fish is traveling to, and applies the value to llLookAt() to have my fish look in that direction.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Ghordon Farina
Script Poet
Join date: 1 Nov 2005
Posts: 126
12-17-2005 23:55
^.^

I could use this with rockets...

And then combine that with the key-passing functions in another post (/54/18/77274/1.html)...

And set up a nice rocket launcher with realistic moving rockets!

Neat.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
12-18-2005 00:20
Senuka,

Are the fish physical? I thought llLookAt was only for non physical objects. *checks wiki*

Nope, works for both! yay!

I'll give it a shot tomorrow, would love the code from your script tho to make it easier :)

Thanks :)
_____________________
----------------------------------------------------------
--The mind's eye is limited only by its focus--