Announcement

Collapse
No announcement yet.

How to align surfaces?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to align surfaces?

    Hello everyone!

    I want to align different surfaces of different size cubes or rectangles with each other using the first one as reference...

    For example I have this 3D cubes and rectangles (In the illustration are 2D but in the real thing are 3D...)
    Click image for larger version

Name:	Imagen1.png
Views:	1
Size:	2.0 KB
ID:	1209178

    And I want to achieve this surface alignment:
    Click image for larger version

Name:	Imagen2.png
Views:	1
Size:	1.7 KB
ID:	1209179

    #2
    If you just need to set this up at design time, you can click the button in the upper-left corner of the Viewport that says "Perspective" to change the view to an "Orthographic View." This will give you a 2D-view and a grid so you can be sure everything is perfectly aligned.
    Learn Unreal Engine 4 | Unreal Engine 4 Book | Unreal Engine 4 Video Course

    Comment


      #3
      If you want this at runtime, you have to do this:
      Pick a plane in which you want to align them. For example, YZ plane, it's normal being the X axis. Let's say that Y is horizontal and Z is vertical.
      To know where to place the mesh, get the position of the mesh on the left on the Y axis , add to that half of its bounds on the Y axis (if it's the first, just set a limit point).
      Then add to that half of the bounds (on Y axis) of the mesh that you want to place. Now you have the horizontal position.
      For the vertical, just take the coordonates of the upper limit (on Z axis) and add half of the vertical bounds of the current mesh (on Z axis). Now you have the vertical position.
      This way you get the location of the current mesh to place.
      Remember that, and redo this for the next mesh.

      Of course, this assumes that all the pivots are in the center of the meshes. If not, you have to adjust the bounds calculations accordingly.

      Comment


        #4
        take a look to Rama┬┤s plugin vertext snapping

        Comment

        Working...
        X