Jump to content
Sign in to follow this  
Johan Laurasia

Object pivot point.

Recommended Posts

Ok, I've been gone a while, and I understand things change, but this is odd to me.  When mesh was first brought into SL, the pivot point you defined in Blender (by editing the object in edit mode, selecting all the verts, and adjusting it's position relative to the object center) was a way to adjust the registration point.  Life was simple.  So lately, I'm making some things that need a pivot point located other than the geometric center of the object, and, as before, I'm editing the mesh in Blender and moving the mesh to where it needs to be to set the object center where I want the pivot point.  However, when I upload it to second life, SL seems to ignore where I set the registration point and rotates the object about the geometric center. 

 

What Gives?

 

Share this post


Link to post
Share on other sites

I have to imagine your recollections are inaccurate. As far as I remember, the inworld pivot/origin has always been the center of the xyz-aligned bounding box. During the beta, there was an experimental pivot offset mechanism, but it was discarded. However, if you are using Blender, there is are two simple ways to move the pivot. However, both of these are ways of extending the bounding box beyond the extent of the visible and physics meshes. That inevitably increases the LOD switch distance, and therefore the download weight.

First is the invisible tab method, described in an old thread. The trick here is how to make sure the added tab doesn't get included in the physics. This is undocumented and is therefore not guaranteed to be everlasting. It's unlikely any changes would affect existing assets though.

The second depends on an even more ubscure "feature", that I did actually report as a bug. So it may be even less likely to remain effective. Again, any change is unlikely to affect existing content. It depends on the detail of how the bounding box is initialised in the uploader, as a zero-sized box at the position of the first encountered geometric point. Subsequently, the box is updated whenever any corner of any triangle lies outside it. If the first point in the collada file is outside the bounding box of all triangles, then the final box will still include that outlying point. So all we need to do is to add a point in the appropriate place, and make it first in the list.

Here is how to do it in Blender, for a simple door. There are variations, of course, in how to place the extra vertex. The crucial step is the sorting of the elements so that the extra point, not part of a triangle, is first.



1. A simple door.

2. Snap the cursor to where you want the pivot/origin. Set editing to cursor mode.

3. Extrude the opposite extreme point and mirror it in X, Y and Z.

4. Snap the cursor to the extra point.

5. Select all and sort elements (Mesh->Sort Elements->Cursor Distance).

Here is the result inworld...



ETA: To get the physics right for this door, it is essential to use the high LOD, then to "Analyze", and to set the type to "Prim. Otherwise the whole bounding box will be solid with an invisible other half. If the door is more complex, then you could use a simple mesh like this as the physics mesh, remembering to Analyze and set to Prim.

ETA: Also, don't forget to add the extra poit to all LODs and to redo the sorting before you export after any changes!

  • Like 1

Share this post


Link to post
Share on other sites

Good tip to remind us about, Drongle.

I'd prefer myself probably to calculate the offset through scripting instead, rather than 'hard-modelling' (made up word :D) it into the mesh itself. Is there any reason why scripting wouldn't be preferrable over this method?

Share this post


Link to post
Share on other sites

Thanks for the verbose explanation Drongle, I had already figured out that I can add the extra vert offset so that the registration point is where it needs to be, I was just wondering why things had changed.  My memory definitely serves me correctly though.  One used to be able to simply edit a mesh and select all verts, and the move the mesh so that the object center would wind up being offset, and it did work throughout beta and even into when it was first released.  I was just curious as to why that had changed.

Thanks again for the info though.

 

- Johan

Share this post


Link to post
Share on other sites


Johan Laurasia wrote:

Thanks for the verbose explanation Drongle, I had already figured out that I can add the extra vert offset so that the registration point is where it needs to be,
I was just wondering why things had changed.
 My memory definitely serves me correctly though.  One used to be able to simply edit a mesh and select all verts, and the move the mesh so that the object center would wind up being offset, and it did work throughout beta and even into when it was first released.
 I was just curious as to why that had changed.

Thanks again for the info though.

 

- Johan

When I asked you, you did not say you "were wondering why things have changed", you said you were wondering:

"how to adjust the pivot point of a mesh object in blender before uploading to SL so that when it uploads to SL, it pivots at the point I set, not the center."  If you already knew the answer, Drongle would not have taken his time to give you nice detailed instructions.

And no, nothing changed. 

Share this post


Link to post
Share on other sites

Yeah right, nothing changed in that regard. The pivot offset never made it on the main grid. The method used was a quick try from Prep to make pivot offsets work, but it never took the collision shape into account as well.

However, in fact it was possible to upload a mesh with that flawed pivot offset even after that abillity was removed during beta. It only worked with meshes which had been uploaded while that offset worked, and you kept the generated .slm file of that mesh upload as well. Uploading that mesh again (after the removal of the offset abillity) utilizing the .slm file during import, kept the pivot offset in-world as well.

Share this post


Link to post
Share on other sites


entity0x wrote:

Good tip to remind us about, Drongle.

I'd prefer myself probably to calculate the offset through scripting instead, rather than 'hard-modelling' (made up word
:D
) it into the mesh itself. Is there any reason why scripting wouldn't be preferrable over this method?

I used to do it with scripting only as well. And probably I would do on large meshes as well today. Because of the LI savings. On anything else I rather add the extra bit to make scripting much easier, and make use of TARGET_OMEGA smooth rotations. Unless you use like a 100 steps on a 90° turn it's still kinda wonky even when it's in a single llSLPPF call with sripting only.

Share this post


Link to post
Share on other sites

I agree that you needed that extra geometry when I started (about four years ago). Lots of conversation on the board then about it as there were plenty of new to mesh folks.  No one EVER mentioned that it had changed but I do remember Drongle saying that pivot points had been tested on the beta grid.  So perhaps it was the beta grid that is the "moving pivot point" memory --- OR for that matter another platform.

 

I always blame my memories that don't coincide with those of others on that alternate world thing -- you know, "B4762-I" :D

Share this post


Link to post
Share on other sites

"Is there any reason why scripting wouldn't be preferrable over this method?"

Is there any reason it would be preferable? I'm not sure whether you mean scripted editing of the collada file or scripted addition of a vertex. Either way, I would expect most would find it easier to do it this simply in the tool they are using already. Of course, if you spend a lot of time scripting, your preferences might get inverted.

ETA: Ah ... from Arton's post, I guess you may have meant scripting the rotation about a different axis. I wouldn't have described that as offsetting the pivot. As he says, that would save the LI penalty, but then you burden the server instead. Anyway, as I hate rotation maths ...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...