Orient on Snap

   3282   7   1
User Avatar
Member
1755 posts
Joined: 3月 2014
Offline
There's a plugin in Sofimage called “quickprimitive” (huge kudos to Piotrek Marczak) which I use mainly for creating aligned Objects to other Object's components.

I looked around to see if Houdini offers something to achieve that and lo and behold, there's an orient on snap in the snap preferences. The joy kinda diminished when I tested it, but the hope remains since the tool's there, it just needs a bit of an improvement - when I snap say a sphere to a point of a grid and set “nearest axis to normal” under orient on snap it will rotate itself after the normal of the point on its nearest axis, but it doesn't take into consideration the point's surroundings. If Y was the axis aligned to the normal, XZ remains untouched. Would be nice if those where aligned as well to the underlying topology. In fact not just nice, but quite useful.

An o related note - wouldn't be more straightforward and useful if in the drop-down list instead of “nearest axis…” options would be X, Y or Z? If you want to align an object after a specific axis, you have to eyeball rotate it first so that the desired axis becomes the “nearest”. Wouldn't be less time consuming if you'd just specify the axis (e.g. Y to normal) and Houdini would do the rest?

Attachments:
obj_orient_snap.jpg (216.6 KB)

User Avatar
スタッフ
1072 posts
Joined: 7月 2005
Offline
McNistor
T- when I snap say a sphere to a point of a grid and set “nearest axis to normal” under orient on snap it will rotate itself after the normal of the point on its nearest axis, but it doesn't take into consideration the point's surroundings. If Y was the axis aligned to the normal, XZ remains untouched. Would be nice if those where aligned as well to the underlying topology. In fact not just nice, but quite useful.

You want to use “Nearest Axis to Frame” if you want the other axes aligned as well.

McNistor
An o related note - wouldn't be more straightforward and useful if in the drop-down list instead of “nearest axis…” options would be X, Y or Z? If you want to align an object after a specific axis, you have to eyeball rotate it first so that the desired axis becomes the “nearest”. Wouldn't be less time consuming if you'd just specify the axis (e.g. Y to normal) and Houdini would do the rest?

I wasn't really thinking about trying to align a specific axis. We either align the z-axis to the normal (Standard Axes to Frame) or the closest axis to the normal to minimize rotation when the mouse moves from one snap target to another. There's no reason we couldn't add two more versions of Standard Axes to Frame, to align the x- or y-axis to the normal, respectively. The issue that arises when trying to align a specific axis is that you might also really care about whether we align the positive or negative axis, and that balloons out the options somewhat.
User Avatar
Member
1755 posts
Joined: 3月 2014
Offline
Ondrej
You want to use “Nearest Axis to Frame” if you want the other axes aligned as well.

But it doesn't work. Maybe I'm doing it wrong or my expectation of what the result should be is different from what you had in mind. I've attached a picture to better describe this.

Ondrej
I wasn't really thinking about trying to align a specific axis. We either align the z-axis to the normal (Standard Axes to Frame) or the closest axis to the normal to minimize rotation when the mouse moves from one snap target to another. There's no reason we couldn't add two more versions of Standard Axes to Frame, to align the x- or y-axis to the normal, respectively. The issue that arises when trying to align a specific axis is that you might also really care about whether we align the positive or negative axis, and that balloons out the options somewhat.

I shall do the unspeakable and talk for everybody: most of the time (like more than 90%), you'll want the object to be aligned on Y to the normal. Think of a squashed sphere that's used for a button on a piece of clothing; or a plant on a ground surface; or a hair strand on a creature; and many other examples.

small note: I don't know why in Houdini it was chosen to associate Z with the normal. I know it's just a convention and you could just as well make it X, but I think most apps out there use Y because of the intuitiveness side: Y is up and standing on a surface (like a human on a planet), up will always be the normal to the surface.
Z is usually associated with depth which is driven by images to displace (or bump) the surface up and down and I guess this is what you had in mind when you chose Z for the normal.
Or it could be because Houdini first had its up as Z and only later changed to Y as up. You tell me which one is it.

You could add just for the positive X and Y (and change the name of the current Z to match the others of course) since the negative could easily be achieved by rotating by 180. So X,Y and Z with alignment on the YZ, XZ and XY respectively.

that balloons out the options somewhat

More is more in this case, which is good.

Attachments:
nearaxis_to_frame.jpg (310.2 KB)

User Avatar
スタッフ
1072 posts
Joined: 7月 2005
Offline
Yes, I see. If you snap to a primitive, we do align the x-axis with its first edge, but with a point we try to align the x-axis with a world axis. The problem with a point is that it's unclear which adjacent point to use for the tangent. I guess we could just pick one.

I think there are multiple reasons we associate z with the normal so much in Houdini. One is definitely the idea of mapping depth to z. In camera space, things coming out of the screen are aligned with the z-axis, and the normal is what is coming out of a surface. Another is particle velocity (or heading), which is often mapped to z when copying for instancing and is often initialized from a normal.
User Avatar
Member
1755 posts
Joined: 3月 2014
Offline
Ondrej
If you snap to a primitive, we do align the x-axis with its first edge, but with a point we try to align the x-axis with a world axis.

The same seems to happen when you align to a primitive. There's definitely some alignment going on there in the sense that you get them in the same orientation every time, but it's not apparent to the naked eye why they are like that.

Ondrej
The problem with a point is that it's unclear which adjacent point to use for the tangent. I guess we could just pick one.

Yup. We could follow the left hand rule and go with the current.
User Avatar
Member
1267 posts
Joined: 3月 2014
Offline
Good find McNistor…very useful.
I wish we had sticky keys in Houdini. It would make snapping so much better.
Werner Ziemerink
Head of 3D
www.luma.co.za
User Avatar
スタッフ
1072 posts
Joined: 7月 2005
Offline
McNistor
Yup. We could follow the left hand rule and go with the current.

It's unclear to me what you mean by the above. Could you clarify?
User Avatar
Member
1755 posts
Joined: 3月 2014
Offline
Nothing important/useful really, just ignore it.
  • Quick Links