Results 1 to 4 of 4

Thread: Normalising Mesh Models

  1. #1
    Member Contributor
    Join Date
    Apr 2004
    Location
    England
    Posts
    74

    Normalising Mesh Models

    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?

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: Normalising Mesh Models

    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.

  3. #3
    Member Contributor
    Join Date
    Apr 2004
    Location
    England
    Posts
    74

    Re: Normalising Mesh Models

    "4) Scale to desired size my multiplying the vertex coord by a factor based on the computed size, you may want symmetric or asymmetric scalin"

    Yes but what is the factor? And how is it derived? This is the crux of biscuit. I really can't think of a way this could be calculated that would work for a every mesh I load in.

    Sorry dorbie, I'll post this kind of stuff in the other forum next time...

  4. #4
    Guest

    Re: Normalising Mesh Models

    say you have some numbers between 0 (min) and 100 (max). if you divide each of these numbers by 100, then youll have numbers between 0 and 1. if you do this for each component (x,y,z), youll have your normalized points.

    the only extra step needed is the translation bit if your model isnt centered at the origin. in genreral, you find the model center (sum of all points divided by the number of points), subtract from each point that center, then divide each component of the result by the max unsigned deviation from the center along each axis.

Similar Threads

  1. Nice models and free models,new site!
    By 3d4ya in forum COLLADA
    Replies: 0
    Last Post: 09-24-2008, 02:04 AM
  2. Replies: 2
    Last Post: 05-04-2005, 07:28 PM
  3. Normalising Mesh Models
    By _new_horizon in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-03-2004, 04:19 PM
  4. mesh models
    By mikemor in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 11-15-2002, 01:07 PM
  5. Where can find 3D-Mesh Models ?
    By in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 12-16-2000, 08:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean