Ixia Posted April 17, 2011 Share Posted April 17, 2011 HiHitting my head against a wall with this... can't seem to figure out how to do it.I want and object to slowly point towards the player (preferably set-able as x degrees per loop)Now but I only want it to rotate on global/world z axis and local y axis :D Can't seem to get it to that :/ Link to comment Share on other sites More sharing options...
Void Singer Posted April 18, 2011 Share Posted April 18, 2011 I hate to tell you, but two axis represent all possible facings (just not all orientations). the function you can try arellLookatllRot2Target with llRotTarget, at_rot_target, and not_at_rot_target and try them in combination withllSetStatus( STATUS_ROTATE_X, FALSE ); Link to comment Share on other sites More sharing options...
Ixia Posted April 18, 2011 Author Share Posted April 18, 2011 I want it non-physical and with llSetRot / llSetLinkPrimitiveParamFast And what do you mean with that two axis represent all possible facings, but not all orientations? I tried around with llRotBetween but no idea how ot apply the result i guess Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 18, 2011 Share Posted April 18, 2011 I am not sure I understand exactly what you want to do, but you might find this little tutorial by Chalice Yao over at SLU helpful. Even if it's not what you're trying to do, it's still worth a read -- it was her walkthrough that got me on the road to understanding how to use llRotBetween. Link to comment Share on other sites More sharing options...
Void Singer Posted April 18, 2011 Share Posted April 18, 2011 for setRot models, if you set the z rotation, then they rotation you shouldn't need to limit anything. what might help you is SLERP... forget about what the name says or how it works, just know that if you plug in the starting rotation, and the ending rotation, that the number you stick in with them will be the fraction of movement between those two rotations. it essentially works out to (a + (1/t )(b-a)), where a=startRot, b=endRot, t=steps between if a is where you are at when you begin, and b is where you want to be when you end, then the result can be added t times to the current rotation to get from start to end. Link to comment Share on other sites More sharing options...
Ixia Posted April 18, 2011 Author Share Posted April 18, 2011 Innula Zenovka wrote: I am not sure I understand exactly what you want to do, but you might find this little tutorial by Chalice Yao over at SLU helpful. Even if it's not what you're trying to do, it's still worth a read -- it was her walkthrough that got me on the road to understanding how to use llRotBetween. ah, that was what I needed thanks Will have to see how to make it slower, but thats the easy part I guess @Void Singer: Well SLERP works too i guess, but since its fractions of the rotation i can't say "rotate towards this but max 2 degress per loop" Link to comment Share on other sites More sharing options...
Innula Zenovka Posted April 18, 2011 Share Posted April 18, 2011 Glad it helped. I think if you want to control the speed, llRotLookAt might be what you want (it works on both physical and non-physical objects) and, as I only discovered the other day, with Void's help, you can just use the formulae Chalice gives there to get the rotations you need for the rotation "target" in llRotLookAt. Certainly worth a play. Link to comment Share on other sites More sharing options...
Void Singer Posted April 19, 2011 Share Posted April 19, 2011 SLERP only returns the rotation you want, the rate control would be up to you, but you could easily say I want it to take x seconds to go from a to b, then you your preferred number of steps to as a divisor for the time as well as the step number for SLERP. assuming you still want discrete stepped movement. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.