Jump to content

Change Pivot Point of Mesh


Guest
 Share

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

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

Recommended Posts

I remember reading about this in a thread a while back when Mesh was still in beta, but I cant seem to find it, and there is a possiblity the process to do this has changed by now. I am wanting to make a door and have the pivot point at the edge instead of the default center. Can someone please explain how to go about doing this?

Thanks,

Lucky



EDIT: I use Google Sketchup 8 to do my modeling.

Link to comment
Share on other sites

I'm not exactly sure how you handle bounding boxes in Sketchup. But...

As for pivots, the uploader doesn't support custom pivots any longer. Prep Linden stated that he is working to bring it back. The hack method of doing a door is to place a single triangle away from the door geometry. This way, the bounding box is twice as wide, and the median center is now at the edge of the door. Then, you have to upload a physics shape that uses a plane with opposite facing normals around the space taken up by the triangle. That will cancel out the collision for that triangle.

  • Like 1
Link to comment
Share on other sites

There was an experimental way to offset the pivot, but it had to be removed because it resulted with inconsistent physics representation on the server. The jira requesting this facility is still open, and it is on the developers list of desirable features, but not clear how soon it might receive attention.

Meanwhile, It is possible to make a door rotate around it's edge, without using a hinge prim,  using the following work-around*. When the door mesh is complete, add a flat plane flap that extends the bounding box from one corner just the right amount to make the center of the bounding box fall on the desired pivot point when viewed along the hinge axis. This is shown with the flap coloured magenta in this picture.  The flap must be a separate material/texture.

egdoormethod.png

This has to be done for all the LOD meshes and the physics mesh. Automatic LOD and physics meshes will not work, as the flap may get decimated away. The top view on the left of the two is the physics mesh for this door.

Now import the model. The crucial step is to use "Solid" decomposition ("Analyze") in the physics tab. This will result in the flat plane being omitted from the physics shape while still having the intended effect of offsetting the pivot. (Note that the current implementation will also stretch the physics mesh bounding box to fit that of the LOD meshes, so that it will be thicker than in the picture. If it matters, this can be avoided if the flap is made wider, so that the bounding box is the same as for the LOD meshes.)

Rez the model and notice that the edit handles appear at the intended pivot point. It will rotate about this point both with the editor's rotate and when rotated by LSL. The flap is visible (from one side) but cannot be collided with. To make it invisible, simply select it's face and assign to it the "default transparent" texture.

* I haven't actually uploaded any of these for a long time. So I can't guaratee that this still works. Perhaps someone will try and confirm or refute below.

Sketchup is a bit strange, as I think it always uses separate objects for each material. In that case, this method will not work unless you import the model, into Blender for example, and join the sparate objects into one mesh. This is pretty necessary for Sketchup models in general, I suppose.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi,

Thanks for the info and instructions. I tried it, but could not get the "flap" part to be phantom. I did make sure solid was checked when I uploaded it, had all my own LOD's including the flap along with the physics mesh. So I'm not sure what I'm doing wrong...or it just doesn't work anymore :/

Any other way to get mesh doors to work?  

Link to comment
Share on other sites

I just tested my pold door and a new one. They both worked OK. I see I didn't mentipon that you need to set the physics shape type to "Prim" (on the features tab of the edoit dialog). If it is left as the default convex hull, then it will effectively fill in the triangular apsce(s) above and below the flap to eliminate the concavities. Did you do that? If not, try it and tell us whether it worked.

Viewer: Second Life 3.0.6 (242181) Oct  3 2011 08:51:02 (Project Viewer - Mesh) {uploader version}

Server: DRTSIM-108 11.09.30.242103 (Aditi). {It's the server that does the physics.}

Link to comment
Share on other sites


Ashasekayi Ra wrote:

As for pivots, the uploader doesn't support custom pivots any longer. Prep Linden stated that he is working to bring it back. The hack method of doing a door is to place a single triangle away from the door geometry. This way, the bounding box is twice as wide, and the median center is now at the edge of the door. Then, you have to upload a physics shape that uses a plane with opposite facing normals around the space taken up by the triangle. That will cancel out the collision for that triangle.

 

Boy, that's a pretty screwy way of doing it, the work around I mean. In 3ds Max, all I had to do to change the pivot point, was create a small box, which has it's own pivot point at it's exact center, and then connect my model to that box. This would change the pivot point to the small boxes pivot point, and then you just have to select that small box as an element, and detach it.

This worked thru most of the open beta, at least when I needed it to, but now, no longer works. I really hope I don't have to do it any other way when Prep does bring it back.

Link to comment
Share on other sites

ahh..I didn't hit the Analyze button after changing it to "solid" in the upload box. So that's what I did wrong.

Also after watching that video I just realized I could make the triangle really small on the end and that should take care of the problem lol. I had it the full width of the door so you really couldn't walk through it. 

Thanks for your input and for the tutorial!

 

Oh and just a little tip after watching the video, you also can duplicate the door and delete all but the bottom or top face, triangulate it, and delete 1 triangle. That way you don't have to make the triangle and snap the vertices, etc.. Just a bit faster :)

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4547 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...