Jump to content

Smooth rotation of a linked prim about an axis that does not intersect the prim's origin


mySky Phenomena
 Share

You are about to reply to a thread that has been inactive for 1415 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello All,

I have a linked prim that I am trying to rotate about an axis that is not through its origin. I wanted this to happen as smoothly as possible, but I want to make sure that the way I am attempting to accomplish this is actually not possible versus me just doing something wrong.

I tried llSetKeyframedMotion, but then realized you can only use this on the root prim. I was then experimenting with llTargetOmega, but couldn't figure out how to move the axis such that it doesn't originate at the origin. 

My wife (the creator of this linked object) has also tried moving the origin to the required point in Blender, but after a ton of digging we've discovered that due to many reasons, this is not possible (without a complicated process to "trick" the SL uploader) when the object is uploaded into SL.

Here's my question: Is it true that my only course of action here is to use a timer event and move the rotation position in increments with the method discussed in the "Rotation" page of the wiki on how to move the rotation axis ("Rotating Vectors")? Is there another method I'm not thinking of? Or am I using the previously mentioned functions incorrectly/not understanding how they work?

Thanks!

Link to comment
Share on other sites

For a start, study the sticky thread at the top of this thread that deals with scripting doors. This is a very common scripting task, because there are lot of things in SL that need to rotate around a hinge.  "Smooth" is often a matter of making cumulative movements that are small enough that they appear continuous -- a matter of balancing step size with duration of the movement, but can also be accomplished by using llTargetOmega or llSetKeyframedMotion alone or in combination with stepwise movement. You can offset the axis of rotation in several ways, depending on how your object is constructed.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

59 minutes ago, mySky Phenomena said:

My wife (the creator of this linked object) has also tried moving the origin to the required point in Blender, but after a ton of digging we've discovered that due to many reasons, this is not possible (without a complicated process to "trick" the SL uploader) when the object is uploaded into SL.

There's really only one reason -- an object's origin in SL will always be the center of its bounding box.

The "trick" is very simple, I recorded a quick video to show how to do it.

  1. I create a new vertex and put it where I want the new center to be.
  2. I move that vertex to the furthest point on the other side of my model to see how far it is. (3.894 meters in my case)
  3. I move that vertex by that amount away from my object, basically mirroring the distance.
  4. I extrude that vertex into a triangle, then scale it down so it can't be seen in SL.

There are other ways to do it, but this will work in all situations.

Otherwise, if you must rotate a linked prim without rotating the root, you're stuck with setting the position in increments depending on the radius and speed of the rotation, which may or may not look anywhere nearly as good as llTargetOmega (which can only rotate around the object's center).

Edited by Wulfie Reanimator
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1415 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...