Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

superimpose to mesh?

Discussion in 'World Building' started by Valentor, Apr 23, 2018.

  1. Valentor

    Valentor

    Joined:
    Apr 23, 2018
    Posts:
    2
    Hi everybody,
    I am actually working on a indie game with some other people. My job is to place in the level the meshes that an other person make. Yesterday the mesh maker send me a big package of mesh ( mainly structure and building mesh) but unfortunately and for an unknown reason: each meshes are not oriented the same way.
    So what i am doing now to make a house for example: I am taking a mesh and I rotate it (1/10 by 1/10 degree) unitil it is oriented well.
    As you can imagine, it is a verry long step to do and the result is far to be perfect.
    So my question is: Is there a tool that could help me to superimpose the mesh A to the mesh B ( some part of the mesh A is in the mesh B too, so I have some part that are my reference points)?
    I know there is the vertex mapping feature but i believe that it's allow only to translate a point of the mesh A to matching point on the mesh B but without correct the rotation.

    Thank for your advice
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,520
    The easiest way to do this is to kick it back to the artist and insist they give it to you in some kind of standard "+Y is up" orientation, otherwise you will ENDLESSLY be fighting this and you will never finish your game. This may require iteration between you and the artist to identify what should be "up" in their 3D editor, when the work is imported into Unity.

    The second way is that if you terrain is not flat, then you need to have the artist either a) make a foundation that you place underneath each building that makes the interface flat, or b) they provide a foundation already attached to the building so that it can be emplaced on uneven terrain.

    In order to decide the height of this foundation, you need to know how uneven your terrain is, i.e., what is the largest vertical delta you expect to place a certain size of object upon.

    Now if you actually want houses to be leaning at funny angles and conforming to the terrain, you can write an editor script that lets you adjust one object to align to the normal of another object. There probably already exists some kind of script like that actually, so I recommend googling around a bit.
     
  3. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Agreed with Kurt. If your team project is going to work, it needs to set reasonable, efficient standards/expectations ASAP (ie, meshes always align with Y up and Z forward). Just imagine this kind of stuff in crunch time :eek: ... or when trying to modify/update several years after release.

    As Kurt also mentioned, make sure this is a team-decision process :D
     
    Kurt-Dekker likes this.
  4. Valentor

    Valentor

    Joined:
    Apr 23, 2018
    Posts:
    2
    Thank you for your answers :)