Page **2** of **2**

### Re: Object centre moving between Blender and OpenSim

Posted: **Wed May 22, 2019 3:08 am**

by **Zed deTremont**

OK, I also get a off centre pivot point and had to think why it does this. The only way I can think of is that for one way or another it doesn't calculate the pivot point according to the geometry as such but according to the cartesian axis. Actually never noticed this before since it's never so obvious as with a tetrahedron. As I see it now it is the only reason I can think of that the pivot is not positioned under the top of the shape. Problem...

Seen afterwords logical but quite annoying in this case.

### Re: Object centre moving between Blender and OpenSim

Posted: **Wed May 22, 2019 7:27 am**

by **Zed deTremont**

Hi again John, right, there are those situations where solutions are so simple that you don't see it at once. Can bang my head on the wall that it took so long.

Since the pivot is calculated compared to the axis and not the actual geometry.

1. I kept the pivot centered under the top of the mesh

2. copied the geometry and gave it a rotation of 180 degrees in the Y axis (Y up). This in such way that the point which invokes the distortion of the centre is exactly doubled.

3. Pick up the the remaining verts which are not needed and set them to the top. Down 1 vert up 3 verts. Combine 2 of the 3 verts to make the geometry as simple as possible.

4. remaining are:

a: The original geometry

b: 2 edges of which on one side 1 vert and on the other 2 stacked verts. Since the are exactly overlapping no geometry can be seen for this part inworld in infinitely narrow plane has been created.

5. Combine the 2 edges and the tetrahedron, just as two mesh objects.

6. The centre will be exactly under the top, I presume this is what you needed.

Trade off: there is an extension to one side which can be avoided and of course has an influence on the physics shape. This I'm afraid is something we have to live with. That against a mesh that has a totally weird <x,y,z> positioning. If this would be possible already.

Sincerely hope that this will work for you.

### Re: Object centre moving between Blender and OpenSim

Posted: **Wed May 22, 2019 12:52 pm**

by **John Hopkin**

Thanks, Zed!

You're definitely on to something with that method. The origin is centred horizontally, which is great for rotations around Z.

Unfortunately, it's not in the centre in other axes, but slightly higher than that. You can check that easily by positioning a slightly smaller sphere in precisely the same region coordinates - the four corners should clip the sphere in exactly the same way. In this model, the top is inside the sphere and the bottom three vertices are outside:

I don't fully understand how you achieved what you have done (the centre looks perfect horizontally), but it certainly made a difference. Would it be possible to do a similar thing in other axes to achieve a vertical centre? Don't worry about the physics - this object will always be phantom.

For background, this is intended to be part of a set of very precise geometric shapes that can be fitted together and moved/rotated precisely (by scripts) to achieve various structures. This is why I've been trying to get everything perfectly proportioned - any slight variations will compound and be visible in the final structures.

If you'd like to Skype to discuss this, just let me know when - I know our timezones are very different, but I'm flexible.

Regarding stacked vertices, I have found those to be a pain in more complex models I've made in the past. I recall spending ages box-selecting every vertex in a model I'd made of a quayside/pier and checking to see if there was more than one in each position. I should have spotted it in the Sketchup model I downloaded - I wonder if that's an artefact of Sketchup or whether the original creator had done that.

Interesting points you make about soft edges. I recall reading somewhere that it's a good idea to bevel edges slightly, but I don't recall having to do that in the stuff I've made in the past. I'll bear this in mind!

### Re: Object centre moving between Blender and OpenSim

Posted: **Wed May 22, 2019 1:59 pm**

by **Zed deTremont**

Hello John,

For good order and if somebody else would have similar problems a short review of our communication.

If you set the tetrahedron with it's geometrical centre at point <0,0,0> of the grid in your 3D application you can use the same trick as described above. Make a two superposed edges from a point <-x,-y,-z> to the exact opposite values <x,y,z>. Make sure that you keep on one of the sides 1 vert. (if you start with for example a cube or plane of which you stack the verts) and keep on the opposite side 2 verts (combine all the rest if you start with a cube).

This way you're able to influence "reset" any pivot point you want inworld. The two superposed edges are absolutely invisible inworld.

Pls mind that this will work for your mesh since you will set them to none physical.

I do not use this for doors or windows for following reasons:

1. The physics will set itself to the most extreme verts in the cartesian axis. iow you'll run in a collider which wouldn't make any sense.

2. it would enlarge the geometry considerable which has it's influence on LODs and therefore you would add more to lag (add to rendering) then strictly needed.

3. There are script that perfectly handle a door/window when the pivot is not in the centre. With all respect and as you know this is "old school tech" to use those systems.

Glad it's worked out.

success

Cheers,

Zed

### Re: Object centre moving between Blender and OpenSim

Posted: **Wed May 22, 2019 3:12 pm**

by **John Hopkin**

I think we have a success here, thanks to Zed.

He demonstrated to me how to create a dummy geometry that forces the centre of the exported object to be in exactly the same position as the geometric centre of the tetrahedron, as he described above. All I had to do was figure out how to do that in Blender (instead of Maya), and it works perfectly.

What a relief!

Many thanks, Zed.