Center of a mesh?

Heyhey, I haven’t found something to chance the center of a mesh in Unity. It is exclusively the job of my 3D modeller to do that?

I’m using Wings3D and there is a center option in it, but it just moves the object in the center of the editor. When I export my modell to fbx and drag it into Unity the center of the mesh isn’t the center of it in Wings3D.

easy, just move the vertices! something like this:

var moveVector : Vector3;
moveVector = Vector3(2.5,1.2,14.2) //you can change this to whatever you want
transform.position = moveVector; //move the center
var mesh = GetComponent(MeshFilter);
var vertices : Vector3[ ] = mesh.vertices;
for (var i = 0; i < mesh.Length; i++){
vertices -= moveVector;// you’d like the mesh to stay at the same position!
}

Toggle the Center/Pivot button in Unity.

–Eric

2 Likes

Placing the object origin in approriate place must be a habbit of your modeller. It will speed up your work.

Oh, I see, there are many ways to do it. I’ll find the best fitting one for my needs, thanks =)