Earnest Clymer
Registered User
Join date: 20 Feb 2005
Posts: 17
|
05-09-2005 21:34
Ok, I'm at a loss (again). I'm trying to get a non-physical thing to roll from a to b, i.e. rotate about its y axis and move along its x axiz. Actually I figured I could probably get away with using llSetTargetOmega() for the "rotating", and just worry about the moving. But how do you move a thing *slowly* and smoothly? I tried breaking up my distance (the circumference) into a number of steps and looping, calling llSetPos( llGetPos() + moveOffset), but its very jerky and upping the number of steps doesn't help much and makes it painfully slow.
I've seen smoothly moving things around, were they all physical? Is there some trick I'm missing?
|
Newfie Pendragon
Crusty and proud of it
Join date: 19 Dec 2003
Posts: 1,025
|
05-10-2005 08:02
I believe llTargetOmega has a 0.2 second delay built in, so it's very difficult to make it rotate at any smooth speed - just too jerky. The other methds I used involved making the prim physical and applying an angular force. I've also seen some convincing objects accomplish it not by actually rotating the object, but by animating the texture on the object to give it the appearance of rotation. Nice thing about animating textures is that they do generally look much smoother and have quite interesting flexibility in the options.
- Newfie Pendragon
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
05-10-2005 10:26
From: Earnest Clymer Ok, I'm at a loss (again). I'm trying to get a non-physical thing to roll from a to b, i.e. rotate about its y axis and move along its x axiz. Actually I figured I could probably get away with using llSetTargetOmega() for the "rotating", and just worry about the moving. But how do you move a thing *slowly* and smoothly? Hola, Currently, there are two ways to accomplish the smooth movement you are requesting. With damped motion you can use llRotLookAt llMoveToTarget. Damped motion physical functions allow you to be very precise when specifying where you want the object to end up (the object's new position/rotation). The speed at which the object moves to that position/rotation can be tuned, but because the functions are damped, there's not much you can do to exactly control the speed of the object. The alternative is using llApplyImpulse and llApplyRotationalImpulse. These functions allow you to set the speed at which the object moves, but the actual position/rotation the object ends up at is goverened only by when you stop the object from moving. For example: if you apply an impulse <1, 0, 0> * llGetMass() to an object, wait 5 seconds, then apply impulse <-1, 0, 0> * llGetMass() (stopping the object), the object would have traveled 5 meters on the x axis. Using llTargetOmega would be sufficiant if you aren't doing anything else at the same time. Due to the fact that llTargetOmega "fakes" rotation - it basically tells the client to rotate an object at a set speed - it will exhibit awkward "snaps" back to its original orientation as each position change occurs. This is because llTargetOmega doesn't modify the actual rotation of the object on the server, when another movement function is called, the client uses the server's view of the object's rotation and position. ==Chris
|
Earnest Clymer
Registered User
Join date: 20 Feb 2005
Posts: 17
|
05-10-2005 22:16
From: Christopher Omega Hola, Currently, there are two ways to accomplish the smooth movement you are requesting. With damped motion you can use llRotLookAt llMoveToTarget. Damped motion physical functions allow you to be very precise when specifying where you want the object to end up (the object's new position/rotation). The speed at which the object moves to that position/rotation can be tuned, but because the functions are damped, there's not much you can do to exactly control the speed of the object. Ok, got it. Exact speed is not as important as arriving at the correct position. The wiki says llMoveToTarget is for physical objects only.. did you have in mind changing to use physics, and then changing back? I was shying away from using physics, a) because I've not used it much, and b) cos it places requirements on the setting of this object (e.g flat ground) that I wanted to avoid. I did play with both however and I might come back to this. From: Christopher Omega The alternative is using llApplyImpulse and llApplyRotationalImpulse. These functions allow you to set the speed at which the object moves, but the actual position/rotation the object ends up at is goverened only by when you stop the object from moving. For example: if you apply an impulse <1, 0, 0> * llGetMass() to an object, wait 5 seconds, then apply impulse <-1, 0, 0> * llGetMass() (stopping the object), the object would have traveled 5 meters on the x axis. Not tried this yet. It might work if I use a stop at either end to ensure it stops in the right place. Currently my object wants to spin and fall over though, that might be a problem (its a disc / coin shape, rolling on its edge) From: Christopher Omega Using llTargetOmega would be sufficiant if you aren't doing anything else at the same time. Due to the fact that llTargetOmega "fakes" rotation - it basically tells the client to rotate an object at a set speed - it will exhibit awkward "snaps" back to its original orientation as each position change occurs. Ah yes, I saw that. Ok, scratch that idea, this is good to know Chris, thanks for all the info. I'll play some more and check back with any progress (or lack of it)
|