Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

the illusive rear-view camera

Trent Hedges
TrentCycle & GRAPHICA
Join date: 4 Sep 2003
Posts: 198
11-21-2006 12:49
Hey all.

I am building a boat - the whole thing is working just JAKE and I have some great dynamics and a solid script.

something is missing though - the rear view cam! When you slap this tug-boat into reverse, i want the camera to whip around to the front and show me where i am putting the boat.

I have a notion of how to do this - I need to set (in region co-ordinates) the CAMERA_POSITION and CAMERA_FOCUS. Focus is easy enough as LLGetPos() since that's where the boat is...

but how do i figure out where roughly 10 meters IN FRONT of the boat is currently? i am having a whale of a time figuring out this math. I can get the rotation of the boat, but how do i plot that 10 meters ahead of my local X axis?

Any help would be greatly appreciated - I am sure one of you has already got this info rattling around in your brain - or will at least see it as a challenge and post me a solution? :)

Cheers,
Trent
_____________________
TrentCycle - Own the Legend. TrentCycle Callisto
TrentVend - Callisto
GRAPHICA Magazine - Designer and Editor www.slgraphica.com
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
11-21-2006 13:47
From: Trent Hedges
I can get the rotation of the boat, but how do i plot that 10 meters ahead of my local X axis?

CODE

llGetPos() + llVecNorm( llRot2Fwd( llGetRot())) * 10.0;