|
Leffard Lassard
Registered User
Join date: 15 Mar 2006
Posts: 142
|
06-20-2006 17:38
I dont mind to step into a deep black whole of lacking knowledge and silence... or is it really impossible to achieve? ... so before I start experiments I think its good to ask here first if someone has knowledge and perhaps a few example functions of how to achieve an orbital like rotation of an object around a given axis. I would assume that a combination of llTorqueAndForce would be the right physics call to achieve a continuous movement... though I am not sure if there is a continuous realtime calculation needed or if a clever calculation of the force directions would do the job as well... or at least reduce the need of too many calculations during runtime. Any funded opinions? I want physics... so Kinematics is no way out... or has someone experiences with llTargetOmega in a physical context for here to share? How does it behave and are the limits of applicability the same as in a non-physics context?
Or am I nuts to wanna achieve this with sl physics and scripting? Hmmm... Regards, Leff.
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
06-20-2006 18:07
I'm not entirely clear on what you're trying to do, but I've had some success with calling llSetForce on a timer, every time pointing the force at the center of the orbit. If you use a force proportional to 1/r^2 you should get orbits under gravity.
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Leffard Lassard
Registered User
Join date: 15 Mar 2006
Posts: 142
|
06-20-2006 19:10
Well... I saw a physical swing under a big cherry tree at Serenity Falls, that swings perfectly smooth with an unbelievable lazy touch around its swinging axis and I was first curious of how they are doing that... and second if this can be extended to the more general use of a complete rotation around a given axis. To your suggestions: But what is r in this case? r is the distance between the center axis of the rotation and the center of gravity of the object which is... hmm.. not accessible via a scripting function afaik... maybe someone else knows better. So a predefined r is only useful if the objects geometric centre and the centre of gravity are the same and therefore known e.g. with an overall symmetric object. With the swing example not taking the centre of gravity taking into account is likely introducing failures... and rather more if the orbit radius isnt that large. Given a swing as an example... the swing operates even more difficult if one or more people sit on it or not.. then sitting on a swing influences the centre of gravity of the overall needed magnitude and direction of the force. Maybe probing with a test rotation to see where the center of gravity is may workaround this. Or do I miss something here?
Another thing is that I already tried a combination of llMoveToTarget to nail the orbiting object to a given position (at the position of the root prim) and do a llApplyRotationalImpulse in a direction... though the results have been stuttery and unusable.... A smooth rotation is of course preferable.
Regards, Leff.
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
06-20-2006 19:31
From: Leffard Lassard Well... I saw a physical swing under a big cherry tree at Serenity Falls, that swings perfectly smooth with an unbelievable lazy touch around its swinging axis and I was first curious of how they are doing that... and second if this can be extended to the more general use of a complete rotation around a given axis. This sounds like it was done with hinges, which are still supported in existing items but cannot now be created (they are on the way out for now, to aid with the eventual move to Havok >1). From: Leffard Lassard To your suggestions: But what is r in this case? r is the distance between the center axis of the rotation and the center of gravity of the object which is... hmm.. not accessible via a scripting function afaik... maybe someone else knows better. So a predefined r is only useful if the objects geometric centre and the centre of gravity are the same and therefore known e.g. with an overall symmetric object. With the swing example not taking the centre of gravity taking into account is likely introducing failures... and rather more if the orbit radius isnt that large. Given a swing as an example... the swing operates even more difficult if one or more people sit on it or not.. then sitting on a swing influences the centre of gravity of the overall needed magnitude and direction of the force. Maybe probing with a test rotation to see where the center of gravity is may workaround this. Regards, Leff. I would imagine that getting something like a swing working without hinges would be very difficult. You may have some luck with the llGetGeometricCenter() function.
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Leffard Lassard
Registered User
Join date: 15 Mar 2006
Posts: 142
|
06-21-2006 04:41
There should be another way to achieve a more or less behaviour like that at least for one axis defined either free or by an existing prim.... Regards, Leff.
|
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
06-21-2006 06:08
Can't you just use x = r cos(theta), y = r sin(theta) to calculate a number of points in the orbit and move between them with llMoveToTarget?
|