1/4 to 1/2 Rotation
|
|
Alexis Starbrook
CEO - Alexis Digital
Join date: 7 Dec 2006
Posts: 135
|
01-08-2007 04:37
Been trying to figure out how to do this but at a loss.
I want a 1/2 sphere to rotate on on axis from 1 to 45 degrees then back again in a constant cycle.
Like a non-spinning/rotating search light ..just straight up then slowy moving down to 45 then reversing and going to 0 again.
Any Ideas?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-08-2007 05:01
llSetRot
|
|
Alexis Starbrook
CEO - Alexis Digital
Join date: 7 Dec 2006
Posts: 135
|
01-08-2007 13:02
Gee..thanks so much for the informative post.. Been there...Done that... Next Please..
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
01-08-2007 13:21
llTargetOmega llSetTimerEvent()
do the math.
_____________________
My SLExchange shopTypos 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.
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
01-08-2007 13:37
I think I know the problem, but I don't have a solution. The problem is SL's rotational interpritation. For some reason SL likes to change the rotations to fit. For example. you may want to rotate a prim 90 degrees on the Y, when you do, x and z are rotated instead to 180, and y is back to 0. It's caused me major headaches in the past. This happens the most with cylinders and spheres from what I've noticed and has given me many a hour of grief. If someone has a simple solution of how to combat this arbitrary rotation problem please post it. 
|
|
RaH Wollongong
Registered User
Join date: 11 Jul 2006
Posts: 19
|
01-08-2007 17:08
From the lslWiki re rotation http://www.lslwiki.com/lslwiki/wakka.php?wakka=rotationvector eul = <0,0,45>; //45 degrees around the z-axis, in Euler form eul *= DEG_TO_RAD; //convert to radians rotation quat = llEuler2Rot(eul); //convert to quaternion llSetRot(quat); //rotate the object The solution is there. vectore eul = <0,0,45> rotates said object on the Z set 45 -45 to get it to rotate back. Short solution rotate your X or whatever once it's done move to the next rot. The example was a search light panning up or down then left or right then back to zero position. psuedo code here vector eul = <-45, 0, 0> points object down state left_right;
inside left_right state you could have eul as <0, 80,0> once done reverse <0,-80,0> once done move back up <0,0,0> // brings us back to zero position.
This is just a quick n dirty example but does what is suggested the object do, rotate down, pan then return to zero position. You could even get crazy and add some random positions using llFrand and lists to set predetermined positions that would be picked at random and executed, if done right it would look more like the light was scanning and searching and not just moving along the predetermined path.
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
01-08-2007 20:49
check out gimbal lock on some euler angles interfering with conversions to quaternians.
|
|
Alexis Starbrook
CEO - Alexis Digital
Join date: 7 Dec 2006
Posts: 135
|
01-08-2007 23:41
From: Senuka Harbinger llTargetOmega llSetTimerEvent()
do the math. I suck at math, a very nice person was nice enough to send me a prim online (Newgate Ludd) actually. Very Much Appreciated) People like YOU, Senuka are why I resort to sarcasm.. Why do you even post? I guess you must be one of those loser that thinks its funny to "answer" like that.. And by the way your "solution" was wrong.. YOUR math sucks too.. Well enough of this ..you are not worth the time... Cheers
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-09-2007 01:45
Alexis, please dont insult others here, it will gain you nothing apart from a reputation and that will just stop anyone from wanting to help you.
Senuka's post, like my own first reply, was minimal because we didnt want to give you a solution, but rather to give you a hint, to tell you which functions could be used. Half the fun of programming is working things out for yourself.
|