Jump to content
Sign in to follow this  
Fenix Eldritch

Blender: help aligning object to axis

Recommended Posts

Newbie question...

Somehow I've managed to mess up my object's rotation. Is there a way to re-align the object based on an arbitrary triangle?

In other words, if I have a triangle within the mesh that I know "should" point up along a specific axis, can I rotate the whole object to match that?

Share this post


Link to post
Share on other sites

If you want to align based upon one of the standard views (ie front, side, top, etc), you need to orient the view so your looking down the axis of rotation and then hit the "R" key and type an angle.  This will rotate the highlighted objects to the standard angle rotation.   If your  looking at a nonstandard axis then you may have some problems.

Share this post


Link to post
Share on other sites

Fenix, I'm having a little bit of a problem really understanding what you want to do.  But I think if you just go to OBJECT mode, select your mesh and rotate it to the axis position you want,  and just hit CTL A choosing select copy  rotation (copy all - location, rotation and scale just to be safe) that might be what you need.  I hope that helps.

Share this post


Link to post
Share on other sites

If I understand your problem correctly, I think you'll have to go to the properties shelf (Press N to toggle) while in object mode, then look under rotation in the transform panel and change the values. If you want to clear the rotation on an axis, then enter 0. If your model wasn't originally pointing in the right direction, I think that would be a bit more difficult. You'll have to rotate it manually in that case.

Share this post


Link to post
Share on other sites

My apologies for the confusion... I should have mentioned that when in object mode, the object reports having a zero rotation - yet the thing is still not aligned. I think I did the equivalent of Apply Rotation when I shouldn't have...

So now I want to re-align it and then apply that rotation again.... what I'm trying to figure out is if it's possible to rotate the mesh such that two arbitrarily selected points would be on the same plane (for example, having the same x, y, or z global coordinate).

 

Share this post


Link to post
Share on other sites

Just go into edit and align your mesh points to whatever axis you prefer, then go into object mode and zero out your rotation on all three axis' either by using the short cut CTL A, or thru the transform palette in the rotation sub-panel.

Share this post


Link to post
Share on other sites

So if i understand you correct, you want to align your entire object by clearing the rotation of one single triangle and let the rest of the object follow this clearing.

I have no elegant solution for this. The easiest would be indeed to realign your object "by hand". Another approach could be to use one helper object, but well, its not elegant and doesn't bring much benefit, except maybe when the adjusting face can not be seen clearly when in top or side view. In that case this ugly approach could help:

 

  1. go to edit mode
  2. Select the one face (triangle or Quad) which you want to use as your reference triangle.
  3. switch to top mode.
  4. SHIFT+d to clone the reference face
  5. p -> selection  (to separate the face into a new object)
  6. Go to Object mode
  7. Select the cloned face
  8. Mesh -> View Global/Local (Numpad / ) so you only see the clone now.
  9. Align the clone to the axes you want. easy: start in top view, rotate, go to side view, rotate again, go to front view, rotate again. done.
  10. Go to the Properties panel and get the 3 axis rotation values of the cloned object
  11. Select your Object. and Object -> Apply -> Rotation.
  12. then copy the rotation values of the cloned object to your object
  13. remove the clone

finished.

as i said, ugly but may work well when you can not easily see the face according to witch you want to align the object. Of course you could script this. But is there a common need for such a function ?

Share this post


Link to post
Share on other sites

There might be.  In modo there's a movable work plane. In that program you would align the workplane to the triangle and then align the mesh to the workplane.

Maybe you need the "snapping" function.  make the triangle a seperate object and then use face snapping, or one of the other snapping options in object mode for aligning your mesh.

Share this post


Link to post
Share on other sites

Looks like you'll have to rotate manually but I doubt it will be precise. You could use Gaia's method and be sure to zoom in as far as you can on the reference triangle when rotating. Maybe cut a line in the triangle so you can compare the allignment of that with the axis.

But if you want to be sure it's exact then you might want to apply some good 'ol trigonometry.

If you want to get all mathematical then...

Go into edit mode and select one of your two vertices.

Go to MESH >> SNAP >> CURSOR TO SELECTED

Then look for 3d cursor location on the properties shelf.

Write those numbers down.

Select your second vertex and repeat above steps to get the coordinates.

I'm not sure what axis you want to rotate on, but if it's on the z axis use the x and y coordinates of each vertex. If on the y axis the x and z, and if on x the y and z. Now...

 Untitled.jpg

I hope I got this right. I had to google for a refresher lol, but I thought this was a good idea. 

Share this post


Link to post
Share on other sites

Here is a way of doing it accurately. It's a bit complicated....

1. Here is the rotated mesh. We want the blue face with one axis along the y axis and the face exactly horizontal (if it's a quad, divide it into triangles first). Select the highest point on the face and snap the cursor to selection. It must stay here throughout. Set the pivot type to 3D cursor. Select the other end of the edge that is to lie along the y axis.

2. Extrude, vertices only, then SZ0 to bring th extruded point level with the pivot point.

3. Extrude, vertices only, then SX0.

4. Select the pivot and the two new points. Fill in the triangle (F). Turn on Edge Angle display.

5. Zoom in to read the angle at the pivot. This is the rotation reqired about the X axis.

6. Select everything except the new points...

7. and apply the Z axis rotation (RZ11.516).

8. Now fill in the triangle including the pivot, the original triangle vertex and the second added point. This now lies in the ZY plane. Read the angle at the pivot. This is the required rotation about the X axis.

9. Apply this rotation to all the original vertices (RX... if it goes the wrong way, put a minus sign in front of it). The edge we have worked on is now parallel to the Y axis. Now we only need to rotate around this edge to get the face horizontal.

10. Select the other vertex of the blue triangle, extrude it, and move the extruded point to the same Z as the pivot (SZ0).

11. Now select the new point and its source point, extrude these, and move to the same Y as the pivot (SY0). Fill in the new triangle and again read the angle at the pivot.

12. Apply this rotation to all the original vertices (RY...). Now the blue face is horizontal, parallel with the xy plane. All that remains is to select all five added vertices and delete them.

derotate.png

Share this post


Link to post
Share on other sites

Thank you all for helping me!

I'm just so used to the concept of working with prims where I can always zero out the rotation of an object perfectly in relation to the world. When I accidentally applied a rotation to my mesh, I lost that "zero reference point" for the "world" ... if that makes any sense.

But using these methods helped a great deal!

Share this post


Link to post
Share on other sites

This problem was really troubling me for hours! I read the instructions in this thread but I somehow had the feeling that there must be an easier way to align objects, one that doesn't require any math.

And there was! After trying many different solutions I finally found one that is pretty simple and should be perfectly accurate. It utilizes the "align view to object" -function and some parenting. It's a bit tricky to explain just with text so here's a quick video tutorial on the subject:

http://oneminutevideotutorials.com/?p=142

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...