PDA

View Full Version : Normalising Mesh Models



_new_horizon
09-03-2004, 02:30 PM
My 3D modelling program loads in .obj and .dxf mesh files created by a variety of programs. The problem, is that these are not created equal: some are off-set from the origin while others are too small or too large. What I need is to scale these meshes as they are loaded so that they occupy a normalised unit cube (say -1 to +1 along each axis) without distorting the mesh iteslf.

These seems like a simply problem, but I have yet to resolve it acceptibly. I'm sure someone here knows how to do this. Any takers?

dorbie
09-03-2004, 03:19 PM
1) Compute the bounds.
2) Find the center & size of the bounds.
3) Translate to the origin by subtracting the center from each vertex.
4) Scale to desired size my multiplying the vertex coord by a factor based on the computed size, you may want symmetric or asymmetric scaling.

You should be posting these kinds of basic questions to the beginners forum, where I'm moving this thread.