Rotate based on surface?

I like this one the best :slight_smile:

not sure how to approach it that way?
Any chance that you can elaborate?

Btw, thanks in advanced. Really appricate you both taking time to help

The mesh lives in local space:

image

So when you rotate, you rotate the mesh, not the actor:

The actor is world aligned and you get more freedom, non-gimbal locked rotations (hopefully) and can avoid quaternion.

Not sure if this is good enough. There’s most like more to consider, some fridge case scenario.

What method are you using to determine the rotation along the surface?
Looking at slow speed of the video, i can see that its the same problem where the direction isn’t always the same when trying to rotate it on a slope

The problem with this method “Quoated” is the direction is changeing if you are moving it on a very steep slope. What i am trying to archive is no matter what slope or angle you rotate it on, the direction is always the same. Unfortunately i can’t seem to know how or even find anything on the internet

Same as before but the mesh has local rotation instead.

There’s probably a good method for transforming all rotations into local space, rotating it all, and then inversing it. Not sure why the vector gets weirdly unrotated but I’m certain there’s a good reason behind it. Sorry.

You can move in and out of local space with the inverse transform node ( and the other that I can’t recall the name of right now ).

Not sure how thats gonna help? maybe i am misunderstanding something?

It’s how to do what @Everynone was talking about…

Okay maybe this would help to explain a bot more on what i want

Imagine i have a object, it has a rotation that is 0,0,45 for X, Y and Z
Then i line traced and got location, i then set the new location.
Now for the rotation. I want it to allign it on the surface of line trace but still keep the forward direction the object is facing

honestly, not sure how to explain it otherwise

That was this post

The chair always puts its back to the selected wall.

Trouble is, you can move it closer to the wall, but you can’t use the trace to get the new location of the chair, because it’s on the wall. Even if you draw a line from the wall to the floor, the chair would be half in / half out of the wall.

That post doesn’t take in count of the forwar direction problem i was talking about.
What this post does is only rotate the object on the normal of the wall

It aligns the forward vector of the chair with the normal of the wall. What else could you do?

I might be explaineing it wrong,

but if you take a look at this picture. The Green one is the original transform, now the other chairs with yellow line is if i were to move the object and allign them to the surface with the same direction as the green. Remeber the yellow line on chair are simple just reference from the green circle chair. Its one chair and they are to represent if i were to move the green circle chair to a location

Ok, so you want to put the base of the chair on the clicked point, but keep the rotation?

I understand all of that, except the one on the ceiling IS rotated.

“In theory” The one on the ceiling is still facing the same direction as the green circle chair, but its allign on the surface of the ceiling as well, it may look a bit different compared to the green chair in terms of the z rotation but thats because i rotated it manualy for demonstration purposes

image

chair

Getting closer, but now it doesn’t seem to completely allign with the surface normal

ah, close though, eh?..

I’ll have another go tomorrow. In fact, I’ve just figured it out ( I think ) but am not at a machine until 2morrow…

This is as close as you can get, I think

chair2

3 Likes